Dim cnnNav3 As SqlConnection = New SqlConnection("Data Source _Up to this point the code seems to run fine, but if I try to say..
& =(local);initial catalog=NAVSQL;Integrated Security = SSPI")
cnnNav3.Open()
Dim strYarn As String
strYarn = cy(j, 0) 'from a previous array
Dim cmdYarnPrice As SqlCommand = cnnNav3.CreateCommand
cmdYarnPrice.CommandType = CommandType.Text
cmdYarnPrice.CommandText = "Select [Standard Cost] from" _
& "Item where [Item No.] = '" & strItem & "'"
Dim daYarnPrice As SqlDataAdapter = New SqlDataAdapter()
daYarnPrice.SelectCommand = cmdYarnPrice
daYarnPrice.Fill(ds, "Item")
Dim dtYarnPrice As DataTable
dtYarnPrice = ds.Tables("Item")
if dtYarnPrice.rows.count > 0I get an error. Debug tells me that dtYarnPrice equals Nothing, so evidently no records were returned, but .NET rejects any expressions like...
if dtYarnPrice = Nothing thenSo how do I determine whether my query returned any rows?? Thanks in advance for your time...
Chandler