老师好,下面的保存列属性想改成这样的格式[第一列],[第二列],[第三列]........,谢谢老师
Dim bm As String = GetConfigValue("bm","")
If e.Form.controls("combobox1").value = Nothing Then
MessageBox.Show("没有输入视图名称,请命名!")
Return
End If
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "Select DISTINCT Count(表名) Fr om {视图} WHERE 表名 = '" & bm & "' and 视图名 = '" & e.Form.controls("combobox1").value & "'"
If cmd.ExecuteScalar() > 0 Then
MessageBox.Show("该视图名已经存在,请重新命名!")
Return
End If
Tables("视图").addnew()
'Tables("视图").current("工号") = dr
Tables("视图").current("表名") = bm
Dim s As String = CurrentTable.GetColVisibleWidth '获得列位置和宽度
Dim ss() As String = s.Split("]")'''''''''''''
s = "" '''''''''''''''
For i As Integer = 0 To ss.Length - 1
If i Mod 2 = 0 Then
s = s & "[" & ss(i)
Else
s = s & "," & ss(i)
End If
Next
s = s.Trim("|")
Tables("视图").current("视图名") = e.Form.controls("combobox1").value
Tables("视图").current("视图属性") = s
DataTables("视图").save()
If DataTables.Contains("视图") Then
DataTables.Delete("视图")
End If
e.Form.close