P
Phaneendra
Hi,
I am trying to develop a Windows application in C#. In
one of the forms i have a few text controls (4 to be
exact). I need to display the values of the columns in a
table (tblCustomer)in the text controls.I did not bind my
controls at design time. In the form load event i created
a sqlDataAdapter and used that to fill my dataset(i named
it DS). I am able to display the values in the first row
of the table correctly. But the problem comes while i am
trying to navigate to the next record.
The code looks like this :
BindingMangerBase LMgr;
form_load
{
sqlDataAdapter da = new sqlDataAdapter("Select * from
tblCustomer", con);
DataSet DS = new DataSet();
da.fill(DS);
Lmgr = this.BindingContext[DS, "tblCustomers"];
txtName.Add("Text", DS.Tables[0], "Name");
}
btn_NextClick
{
LMgr.Position += 1;
}
I defined LMgr to use for navigation. But the last line is
giving an error " Cannot create Child List for
tblCustomer". I tried various ways of defining the
BindingContext, but the problem remains the same. MSDN
documentation states the above exception under the
Exception heading. But does not specify why it happens or
what needs to be done to overcome this. Please advise.
Thank you for your time.
regards,
Phaneendra.
I am trying to develop a Windows application in C#. In
one of the forms i have a few text controls (4 to be
exact). I need to display the values of the columns in a
table (tblCustomer)in the text controls.I did not bind my
controls at design time. In the form load event i created
a sqlDataAdapter and used that to fill my dataset(i named
it DS). I am able to display the values in the first row
of the table correctly. But the problem comes while i am
trying to navigate to the next record.
The code looks like this :
BindingMangerBase LMgr;
form_load
{
sqlDataAdapter da = new sqlDataAdapter("Select * from
tblCustomer", con);
DataSet DS = new DataSet();
da.fill(DS);
Lmgr = this.BindingContext[DS, "tblCustomers"];
txtName.Add("Text", DS.Tables[0], "Name");
}
btn_NextClick
{
LMgr.Position += 1;
}
I defined LMgr to use for navigation. But the last line is
giving an error " Cannot create Child List for
tblCustomer". I tried various ways of defining the
BindingContext, but the problem remains the same. MSDN
documentation states the above exception under the
Exception heading. But does not specify why it happens or
what needs to be done to overcome this. Please advise.
Thank you for your time.
regards,
Phaneendra.