Object Reference Error Message

T

tjonsek

When executing the following code, I get this error message:
Object reference not set to an instance of an object
It bombs out on me rigth at the cmdWO.CommandText statement.
If you have any ideas, please share them!

Dim strWO As String
Dim rdrWO As System.Data.SqlClient.SqlDataReader
Me.cnnContract.Open()
cmdWO.Connection = cnnContract
cmdWO.CommandText = "Select * from ContractOutWO where ID="
& txtFind.Text


rdrWO = cmdWO.ExecuteReader
With rdrWO
While .Read


strWO = strWO & rdrWO.GetString(1) & ","
'.NextResult()

End While

End With
rdrWO.Close()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top