Problem with Adding Rows to GridControl

  • Thread starter Thread starter Carl Maloney
  • Start date Start date
C

Carl Maloney

I am trying to add records to a grid control. I enter in the first
record(Person A), then press add, Person A gets added. Then I try to
add another record(Person B) and Person B replaces Person A. Does
anyone have any solutions? Thanks

Carl
 
Try posting some snippet code
And look at your sql statement
Patrick
 
Right now I do not have anything connected to a SQL database. Just
trying to add records from text boxes:

DataTable table = ds.Tables["newOrder"];
DataRow row = table.NewRow();
row["Players Name"] = fName.Text + lName.Text;
row["Jersey"] = jerNum.Text + " WA";
row["Roll"] = rollNum.Text;
row["Frame"] = sNum.Text;
table.Rows.Add(row);
indOrder.DataSource = ds.Tables["newOrder"];
indOrder.DataBind();
 
Its possible that the line below return a new DataTable each time you try to add a new row.

DataTable table = ds.Tables["newOrder"];

Think you should debug it and find out.

Chineme Nnamdi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top