Hi,
I am using OleDbConnection , OleDbAdapter, OledbCommand with parameter
I am having problem with binding the textbox''s text property with the result.
I am sending the code also:
string strOleDb;
strOleDb =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\kp\db1.mdb";
OleDbConnection cn = new OleDbConnection();
cn.ConnectionString = strOleDb;
string searchText = "select programs_interest from follow_up_report where no_of_children = ?";
OleDbDataAdapter da = new OleDbDataAdapter(searchText, cn);
OleDbCommand selectCommand = new OleDbCommand(searchText,cn);
da.SelectCommand = selectCommand;
selectCommand.Parameters.AddWithValue("no_of_children", no_of_childrenTextBox.Text);
DataSet ds = new DataSet("follow_up_report");
da.Fill(ds, "follow_up_report");
programs_interestTextBox.DataBindings.Add("Text", ds.Tables["follow_up_report"], "programs_interest");
this is giving the following error :
This causes two bindings in the collection to bind to the same property.
Parameter name: binding
Let me know.
My email address:
[email protected]
Thank you.