M
MikeY
Hi everyone,
I have posted earlier this week, but I'm still scratching my head trying to
figure out how to change/modify my data back to my db.
Using C# Windows forms. I am trying to learn how to modify existing data
with in my DB/MSDE. In general, I have textbox's filled with existing data
from my "Employee" table. I have amongst other buttons, an "Update" button.
Where, when viewing, if I want to change ie the persons name, anyother
field, or all fields I want to press the update button. However I am getting
lost. My code is below with the 3 fields I want to update. Mapping is in the
correct order. Hopefully someone can help by providing correct code or a
link example.
private void btnEmpModify_Click(object sender, System.EventArgs e)
{
DataTable thisTable = dsModifyRecord.Tables["Employee"];
//THIS IS WHERE I'M GETTING LOST
thisTable.Rows[??????????????];
thisRow["EmpFName"] = txtBoxEmpFName.Text;
thisRow["EmpLName"] = txtBoxLNName.Text;
thisRow["EmpTitle"] = txtBoxEmpTitle.Text;
//& GETTING LOST HERE
dsModifyRecord.Tables["EMPLOYEE"]??????????????
sqlDataAdapter1.Update(dsModifyRecord, "Employee");
}
Thank you all in advance
MikeY
I have posted earlier this week, but I'm still scratching my head trying to
figure out how to change/modify my data back to my db.
Using C# Windows forms. I am trying to learn how to modify existing data
with in my DB/MSDE. In general, I have textbox's filled with existing data
from my "Employee" table. I have amongst other buttons, an "Update" button.
Where, when viewing, if I want to change ie the persons name, anyother
field, or all fields I want to press the update button. However I am getting
lost. My code is below with the 3 fields I want to update. Mapping is in the
correct order. Hopefully someone can help by providing correct code or a
link example.
private void btnEmpModify_Click(object sender, System.EventArgs e)
{
DataTable thisTable = dsModifyRecord.Tables["Employee"];
//THIS IS WHERE I'M GETTING LOST
thisTable.Rows[??????????????];
thisRow["EmpFName"] = txtBoxEmpFName.Text;
thisRow["EmpLName"] = txtBoxLNName.Text;
thisRow["EmpTitle"] = txtBoxEmpTitle.Text;
//& GETTING LOST HERE
dsModifyRecord.Tables["EMPLOYEE"]??????????????
sqlDataAdapter1.Update(dsModifyRecord, "Employee");
}
Thank you all in advance
MikeY