J
jtnpham
Hi, I am programming in vb.net for an asp.net web page. I have the
following code:
sqlStr = "SELECT dbo_shoporder.shopordernumber, authtable.authno FROM
authTable INNER JOIN dbo_ShopOrder ON authtable.shoporderno =
dbo_shoporder.shopordernumber WHERE dbo_shoporder.workcenterid ='" &
Convert.ToString(txtWcSearch.Text) & "' AND authTable.workcenterid =
'" & Convert.ToString(txtWcSearch.Text) & "';"
Dim dataAdapter3 As New OleDbDataAdapter(sqlStr, connStr)
Dim dt3 As New Data.DataTable
dataAdapter3.Fill(dt3)
gvData.DataSource.Equals(dt3)
dataAdapter3.Dispose()
Now, when I run it I get this exception:
"Object reference not set to an instance of an object."
And then when I put this in the help search it returned something with
the GetValue Method (obj,obj). Can someone explain this to me? I
tried looking at it in MSDN but it wasn't a very good example and did
not explain much to me.
Basically, my SELECT statement is grabbing shop order numbers from
dbo_shopOrders and authorization numbers from authTable where the work
center equals whatever is typed in the textbox: txtWcSearch.text.
Any help would be great!
Thanks! =)
following code:
sqlStr = "SELECT dbo_shoporder.shopordernumber, authtable.authno FROM
authTable INNER JOIN dbo_ShopOrder ON authtable.shoporderno =
dbo_shoporder.shopordernumber WHERE dbo_shoporder.workcenterid ='" &
Convert.ToString(txtWcSearch.Text) & "' AND authTable.workcenterid =
'" & Convert.ToString(txtWcSearch.Text) & "';"
Dim dataAdapter3 As New OleDbDataAdapter(sqlStr, connStr)
Dim dt3 As New Data.DataTable
dataAdapter3.Fill(dt3)
gvData.DataSource.Equals(dt3)
dataAdapter3.Dispose()
Now, when I run it I get this exception:
"Object reference not set to an instance of an object."
And then when I put this in the help search it returned something with
the GetValue Method (obj,obj). Can someone explain this to me? I
tried looking at it in MSDN but it wasn't a very good example and did
not explain much to me.
Basically, my SELECT statement is grabbing shop order numbers from
dbo_shopOrders and authorization numbers from authTable where the work
center equals whatever is typed in the textbox: txtWcSearch.text.
Any help would be great!
Thanks! =)