set a field to subject

  • Thread starter Thread starter SALIH ATAOZ
  • Start date Start date
S

SALIH ATAOZ

cnn.Open()

Dim sql As String
sql= "select * from users where username='" &_
TextBox1.Text & "' and password='" & TextBox2.Text & "';"

Dim dt As New DataTable()
i have problem downstaires





Dim dausers As New OleDb.OleDbDataAdapter(sql, cnn)

dausers.Fill(dt)

If dt.Rows.Count > 0 Then

Dim subject As String = dt.FIELDS("defaultmnu")

'*****************************************************
'PREVIOUS LINE I WANT TO FINT FIELD DATAFAULTMNU AND SET
'IT TO SUBJECT. HERE I HAVE A PROBLEM how can 1 do that



Select Case subject

Case "BASKI"
Me.Hide()
Dim frmbaski As New frmbaski()
frmbaski.Show()
frmbaski.Text = "Baski Giris Formu"


Case "STOK"
Me.Hide()
Dim FrmStok As New FrmStok()
FrmStok.Show()


Case "MUHASEBE"
Me.Hide()
Dim Frmmuhasebe As New FrmMuhasebe()
Frmmuhasebe.Show()

End Select

Else
MsgBox("No users",MsgBoxStyle.Critical, "Office")

End If
 
The problem is that you are looking at the field definition in the
datatable. It doesn't know what row you wish to look at. I am assuming
that you want the value from the first row returned? If so, the following
should work.

Dim subject As String = dt.rows(0)("defaultmnu")
 
Back
Top