Hi everyone
i was going through the book
vb.net & databases and i was stuck at chapter 6.
What is the DALBase? i tried to use it when i was writing code but i get errors.
Also i tried to use the oledbdatareader with a sql statement that includes the where clause. When i include the where its not working and when i take it off its working fine any ideas?
here is my code
Dim Cmd As OleDb.OleDbCommand
Dim Con As OleDb.OleDbConnection
Dim Sql As String = Nothing
Dim Reader As OleDb.OleDbDataReader
Dim ComboRow As Integer = -1
Dim Columns As Integer = 0
Dim Category As String = Nothing
'CmbBoxMan.Items.Clear()
Dim s1, s2 As String
s1 = TextBox1.Text
s2 = TextBox2.Text
Con = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OleD b.4.0;data source=c:\temp\college1.mdb")
Sql = "SELECT [FA_NAME] FROM [FACULTY]" ' WHERE [FA_ACCOUNT] = """ + s1 + """ And [FA_PIN] = " + s2 + ""
Cmd = New OleDb.OleDbCommand(Sql, Con)
Con.Open()
Reader = Cmd.ExecuteReader()
While Reader.Read()
For Columns = 0 To Reader.FieldCount - 1
Category = Reader.Item(Columns) 'READ COLUMN FROM DATABASE
Next
Label7.Text += Category
'CmbBoxMan.Items.Add(Category)
ComboRow += 1
End While
Con.Close()