VB.net 查询获取数据库数据信息
(编辑:jimmy 日期: 2024/11/17 浏览:3 次 )
复制代码 代码如下:
'数据操作执行
Public Sub getConn(ByVal SqlStr As String, ByVal TableName As String)
Try
objCommand.CommandText = SqlStr
objDataSet.Clear()
objDataAdapter.SelectCommand = objCommand
objDataAdapter.Fill(objDataSet, TableName)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
'数据操作执行
Public Sub getConn(ByVal SqlStr As String, ByVal TableName As String)
Try
objCommand.CommandText = SqlStr
objDataSet.Clear()
objDataAdapter.SelectCommand = objCommand
objDataAdapter.Fill(objDataSet, TableName)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
下一篇:asp.net连接数据库 增加,修改,删除,查询代码