Object Reference Error Message

  • Thread starter Thread starter tjonsek
  • Start date Start date
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

Back
Top