'根据表名或 表'获取表中 除图片类型外的字段名
Public Function GetTableFields(ByVal tbname As String) As DataView
If tbname = "" Then
MsgBox("请输入参数:表名")
Exit Function
End If
Dim strsql As String
strsql = "select COLUMN_NAME as [字段名],DATA_TYPE "
strsql += "FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME='" + tbname + "' and DATA_TYPE<>'image'"
Dim db As New DataBase
Dim dv As New DataView
Dim i As Integer
Try
dv = db.RunSelectSQL(strsql)
Return dv
Catch ex As Exception
MsgBox(ex.Message + vbCrLf + ex.StackTrace)
Return Nothing
Finally
db.Dispose()
dv.Dispose()
End Try
说明: database 是自己定义的一个数据通用 类