中间对数据库操作使用的是:sqlHelper.vb
Imports System.Data Imports System.Data.sqlClient Public Class UserClass Dim sql As String Public Function Add(ByVal dm As Object) As Boolean Dim pr(10) As sqlParameter sql = "insert into tbl() values " sql = sql & "()" If sqlHelperExt.ExecuteNonQuery(sql,pr) >= 1 Then Return True Else Return False End If End Function Public Function Update(ByVal dm As Object) As Boolean Dim pr(10) As sqlParameter sql = "update tbl set x=@x where id=" & dm If sqlHelperExt.ExecuteNonQuery(sql,pr) >= 1 Then Return True Else Return False End If End Function Public Function Delete(ByVal id As String) As Boolean sql = "delete from tbl where id=" & id sql = "update tbl set strStatus='void' where id=" & id sqlHelperExt.ExecuteNonQuery(sql) End Function Public Function CheckRsExist(ByVal id As String) As Boolean sql = "select 1 from tbl where id=" & id Return sqlHelperExt.CheckRsExist(sql) End Function Public Function GetTable() As DataTable Return Me.GetTable("") End Function Public Function GetTable(ByVal id As String) As DataTable Return Nothing End Function Public Function GetTableCN() As DataTable Return Me.GetTableCN("") End Function Public Function GetTableCN(ByVal id As String) As DataTable Return Nothing End Function End Class