Here is what I have:
Dim strConn As String
Dim sqlCon As SqlClient.SqlCo nnection
Dim sqlCmd As SqlClient.SqlCo mmand
Dim sqlAdapt As SqlClient.SqlDa taAdapter = New sqlclient.dataA dapter()
strConn = "data source=LHPSERVE ;initial catalog=AssetTr akker;integrate d
security=SSPI;p ersist security info=False;work station id=LHPSERVE;pac ket
size=4096"
sqlCon = New SqlClient.SqlCo nnection(strCon n)
sqlCon.Open()
dsAssets = New Data.DataSet("d sAssets")
sqlCmd = New SqlClient.SqlCo mmand("Select * from tblAssets")
sqlCmd.CommandT ype = CommandType.Tex t
sqlCmd.Connecti on = sqlCon
sqlAdapt.Select Command = sqlCmd
sqlAdapt.Fill(d sAssets, "tblAssets" )
--------------------------------------------------------
Is there a way to make this simpler? DO I really need the sqlCmd ?
Thanks
Adam
Dim strConn As String
Dim sqlCon As SqlClient.SqlCo nnection
Dim sqlCmd As SqlClient.SqlCo mmand
Dim sqlAdapt As SqlClient.SqlDa taAdapter = New sqlclient.dataA dapter()
strConn = "data source=LHPSERVE ;initial catalog=AssetTr akker;integrate d
security=SSPI;p ersist security info=False;work station id=LHPSERVE;pac ket
size=4096"
sqlCon = New SqlClient.SqlCo nnection(strCon n)
sqlCon.Open()
dsAssets = New Data.DataSet("d sAssets")
sqlCmd = New SqlClient.SqlCo mmand("Select * from tblAssets")
sqlCmd.CommandT ype = CommandType.Tex t
sqlCmd.Connecti on = sqlCon
sqlAdapt.Select Command = sqlCmd
sqlAdapt.Fill(d sAssets, "tblAssets" )
--------------------------------------------------------
Is there a way to make this simpler? DO I really need the sqlCmd ?
Thanks
Adam
Comment