老师好,能保存成这样的视图格式吗 编号,50|日期,120|年,40|季,30|月,30|项目,60|项目ID,80
下面是保存视图的代码
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 '获得列位置和宽度
Tables("视图").current("视图名") = e.Form.controls("combobox1").value
Tables("视图").current("视图属性") = s
DataTables("视图").save()
If DataTables.Contains("视图") Then
DataTables.Delete("视图")
End If
e.Form.close