hi,
i have Ms Access database having three fields
ID
username
password
and i want to make form that update them, my table name is studentLoginData
MessageBox.Show("the password is matched");
String conString = "Provider=Microsoft.Jet.OLEDB.4.0;"
+ "Data Source=C:\\Documents and Settings\\Wasif\\My Documents\\studentLogin.mdb";
SqlConnection objConn = new SqlConnection(conString);
try
{
objConn.Open();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
SqlDataAdapter daAuthors = new SqlDataAdapter("Select * From StudentLoginData", objConn);
DataSet dsPubs = new DataSet("Pubs");
daAuthors.FillSchema(dsPubs, SchemaType.Source, "studentData");
daAuthors.Fill(dsPubs, "studentData");
DataTable tblAuthors;
tblAuthors = dsPubs.Tables["studentData"];
try
{
DataRow drCurrent;
drCurrent = tblAuthors.NewRow();
drCurrent["ID"] = txt_id.Text;
drCurrent["username"] = txt_username.Text;
drCurrent["password"] = txt_password.Text;
drCurrent = tblAuthors.Rows.Find(txt_id.Text);
drCurrent.BeginEdit();
drCurrent["ID"] = txt_id.Text + drCurrent["ID"].ToString().Substring(0);
drCurrent["username"] = txt_username.Text + drCurrent["username"].ToString().Substring(1);
drCurrent["password"] = txt_password.Text + drCurrent["password"].ToString().Substring(2);
drCurrent.EndEdit();
MessageBox.Show("record has been updates");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
there is my code