lundi 11 mai 2015

Can not found Row 0 in vb.NET

I try to select the first row and first item from my SQL But, it show me message "Can not found Row 0 "

sqlCmd1 = "SELECT Type.Name FROM Type INNER JOIN Room ON Type.TID = Room.TypeID WHERE (((Room.ROID)= " + (roomCB.SelectedIndex + 1).ToString() + "));"
ad = New OleDb.OleDbDataAdapter(sqlCmd1, cnn)
ds = New DataSet
ad.Fill(ds)
Try
    typeTxt.Text = ds.Tables(0).Rows(0).Item(0)
Catch ex As Exception
    MsgBox(ex.Message)
End Try

Aucun commentaire:

Enregistrer un commentaire