Bind Text Boxes to DataSet

  • Thread starter Thread starter Steve Bishop
  • Start date Start date
S

Steve Bishop

All the examples I have bind text boxes to the DataReader. Can someone
give me an example on how to bind some text boxes or labels to my
DataSet object. Help appreciated. Thanks.
Steve
 
myLabel.DataBindings.Add("Text", datasetName "Table.FieldName")
or ("Text", DataSetName.Tables[Whatever], "FieldName")

You'll also want to check out the bindingcontext class
 
I tried a couple combinations here but not having luck. I get error:
Compiler Error Message: CS0117: 'System.Web.UI.WebControls.TextBox' does
not contain a definition for 'DataBindings'

Source Error:
Line 29: objDataSet.Tables["dtAR1"].DefaultView.RowFilter =
Filter;
Line 30:
Line 31: TextBox3.DataBindings.Add("Text",
objDataSet.Tables["dtAR1"], "CustomerNumber");
Line 32: TextBox4.DataBindings.Add("Text",
objDataSet.Tables["dtAR1"], "CustomerName");
Line 33:

Help apprecaited
 
Back
Top