I simply *cannot* get this dang textbox to bind...
below is my code, throwing the following error:
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Cannot bind to property or column CUSTID on DataSource.
Any idea what I might be doing wrong?
private void btnNew_Click(object sender, System.EventArgs e)
{
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString=("Data Source=SERVER;Initial Catalog=DATABASE;User Id=user;Password=test");
oSQLConn.Open();
DataSet dsCustomers = new DataSet();
SqlDataAdapter daCustomers = new SqlDataAdapter("SELECT * FROM customers WHERE (CUSTID = 14442182)", oSQLConn);
daCustomers.Fill(dsCustomers); txtSettleCtrlNum.DataBindings.Add("Text",dsCustomers,"CUSTID");
}
below is my code, throwing the following error:
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Cannot bind to property or column CUSTID on DataSource.
Any idea what I might be doing wrong?
private void btnNew_Click(object sender, System.EventArgs e)
{
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString=("Data Source=SERVER;Initial Catalog=DATABASE;User Id=user;Password=test");
oSQLConn.Open();
DataSet dsCustomers = new DataSet();
SqlDataAdapter daCustomers = new SqlDataAdapter("SELECT * FROM customers WHERE (CUSTID = 14442182)", oSQLConn);
daCustomers.Fill(dsCustomers); txtSettleCtrlNum.DataBindings.Add("Text",dsCustomers,"CUSTID");
}