hi Programmers. Can anyone help me.. How can i get data from - TopicsExpress



          

hi Programmers. Can anyone help me.. How can i get data from table2 when i search ID combobox. it will display to Age from Table2... This is My Code... Try Using conn As New OleDbConnection(Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Database1.mdb;) conn.Open() Dim command As New OleDbCommand(SELECT ID, FIRSTNAME, LASTNAME, MI, AGE FROM [Table1,Table2] where ID = @ID, conn) command.Parameters.AddWithValue(@ID, ComboBox1.Text) Dim ds As New DataSet Dim da As New OleDbDataAdapter da.SelectCommand = command da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then TextBox1.Text = ds.Tables(0).Rows(0).Item(FIRSTNAME) TextBox2.Text = ds.Tables(0).Rows(0).Item(LASTNAME) TextBox3.Text = ds.Tables(0).Rows(0).Item(MI) TextBox4.Text = ds.Tables(0).Rows(0).Item(AGE) End If conn.Close() End Using Catch ex As Exception MsgBox(ex.ToString) End Try End Sub
Posted on: Sat, 01 Feb 2014 07:38:20 +0000

Trending Topics



>

Recently Viewed Topics




© 2015