By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,297 Members | 1,409 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,297 IT Pros & Developers. It's quick & easy.

set a field to subject

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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")
"SALIH ATAOZ" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
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

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.