Hi I keep getting the following error and cant seem to figure it out;
Object reference not set to an instance of an object.
below is the code block which it finds the error;
Dim dst as DataSet
Dim dad as sqlDataAdapter
Dim strSql as string
Sub LoadDetails()
dst = new dataset
strSql= strSql.format("select Sales from tblSales where SalesID={0}",radioSales.selecteditem.value)
conn = new sqlConnection(strConn)
dad = new sqldataadapter(strSql,conn)
dad.fill(dst,"tblSales")
txtSales.text = dst.tables(0).rows(0).item(0)
datagrid2.datasource=dst
datagrid2.databind()
conn.close()
End Sub
Any help would be appreciated.
Cheers
Rich
Object reference not set to an instance of an object.
below is the code block which it finds the error;
Dim dst as DataSet
Dim dad as sqlDataAdapter
Dim strSql as string
Sub LoadDetails()
dst = new dataset
strSql= strSql.format("select Sales from tblSales where SalesID={0}",radioSales.selecteditem.value)
conn = new sqlConnection(strConn)
dad = new sqldataadapter(strSql,conn)
dad.fill(dst,"tblSales")
txtSales.text = dst.tables(0).rows(0).item(0)
datagrid2.datasource=dst
datagrid2.databind()
conn.close()
End Sub
Any help would be appreciated.
Cheers
Rich