Nerine
Member
my question is how to binding textbox to dataset?
with this code it will show exception say that can't bind to datasource!!
if i use
it will just show first result..
i need it to able to show all search result when i click the Next and Previous button....
p/s : Pls Correct Me If I Post On Wrong Section !!
VB.NET:
Dim Connection As New OleDb.OleDbConnection
Dim DAExample As New OleDb.OleDbDataAdapter
Dim DSExample As New DataSet("DSExample")
Connection.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Application.StartupPath & "\Example.mdb"
Dim SelectCommand As New OleDb.OleDbCommand("SELECT * FROM Example WHERE Name LIKE '%' + @Name + '%'")
Dim SelectParameter As OleDb.OleDbParameter = SelectCommand.CreateParameter
SelectParameter.ParameterName = "@Name"
SelectParameter.Value = TxtSearch.Text
SelectCommand.Parameters.Add(SelectParameter)
DAExample.SelectCommand = SelectCommand
DAExample.SelectCommand.Connection = Connection
DSExample.Clear()
DAExample.Fill(DSMember, "Member")
Data_Binding()
Private Sub Data_Binding()
TxtName.DataBindings.Add("TEXT", DSExample, "Name")
TxtID.DataBindings.Add("TEXT", DSExample, "ID")
End Sub
with this code it will show exception say that can't bind to datasource!!
if i use
VB.NET:
TxtName.DataBindings.Add("Text", DSExample.Tables(0), "Name")
it will just show first result..
i need it to able to show all search result when i click the Next and Previous button....
p/s : Pls Correct Me If I Post On Wrong Section !!