However, once I go to enter that next row, all it does it replace the first row it added, it never adds additional rows to the dataset. Can anyone explain where I've gone wrong?
Here is the code:
Java
//load data set info
DataSet ds = new DataSet("data");
bowlers.ReadXml(Application.StartupPath + "\\file_" + GLB.filedate + ".xml");
dataGrid1.DataSource = bowlers;
dataGrid1.DataMember = "bowlers";
DataRow dr = bowlers.Tables[0].NewRow();
dr["firstName"] = this.textBox1.Text;
dr["lastName"] = this.textBox2.Text;
if (this.checkBox1.Checked == true)
{
string jackpot = "Yes";
dr["jackpot"] = jackpot;
}
else
{
string jackpot = "No";
dr["jackpot"] = jackpot;
}
if (this.checkBox2.Checked == true)
{
string eliminator = "Yes";
dr["eliminator"] = eliminator;
}
else
{
string eliminator = "No";
dr["eliminator"] = eliminator;
}
dr["num_brackets"] = this.numbrackets.Text;
bowlers.Tables[0].Rows.Add(dr);
Answers
Know the answer? Post it. Somebody with the same question will find it here.