Click here to Skip to main content
15,894,720 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi everybody ,
Am updating one form..EDIT PROFILE...Am able to update all fields except 'Password' field which is Text datatype..As i never worked on MS-Access I DONT KNOW WHERE IT WENT WRONG....Its working fine if i wont update that field...All remaining fields are getting updated...pls help..
Posted
Comments
Prasad_Kulkarni 6-Sep-12 8:59am    
Can you post some code snippets?
ZurdoDev 6-Sep-12 9:20am    
We can't see anything you have so you'll have to share a lot more information.
Radhika Vyas 7-Sep-12 1:00am    
HI Everybody here is my code..If I try with commented part its giving exception Somehting as Incorrect Update Syntax..please help...If i comment that query without password its working fine...
try
{

string path1 = System.Configuration.ConfigurationManager.AppSettings.Get("databasepath");
OleDbConnection con = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + path1);
con.Open();
// OleDbCommand cmd = new OleDbCommand("UPDATE codefixermp_tblMembers SET Firstname=@Firstname, Lastname=@Lastname,Address=@Address,City=@City,County=@County,Country=@Country,PostCode=@PostCode,Email=@Email,Tel=@Tel,Password=@Password,Comments=@Comments WHERE ID=" + uID.Text + "", con);
OleDbCommand cmd = new OleDbCommand("UPDATE codefixermp_tblMembers SET Firstname=@Firstname, Lastname=@Lastname,Address=@Address,City=@City,County=@County,Country=@Country,PostCode=@PostCode,Email=@Email,Tel=@Tel,Comments=@Comments WHERE ID=" + uID.Text + "", con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@Firstname", txtFirstName.Text);
cmd.Parameters.AddWithValue("@Lastname", txtLastName.Text);
cmd.Parameters.AddWithValue("@Address", txtAddress.Text);
cmd.Parameters.AddWithValue("@City", txtCity.Text);
cmd.Parameters.AddWithValue("@County", txtState.Text);
cmd.Parameters.AddWithValue("@Country", txtCountry.Text);
cmd.Parameters.AddWithValue("@PostCode", txtPostcode.Text);
cmd.Parameters.AddWithValue("@Email", txtEmail.Text);
cmd.Parameters.AddWithValue("@Tel", txtTel.Text);
//cmd.Parameters.AddWithValue("@Password", txtPassword.Text);
cmd.Parameters.AddWithValue("@Comments", txtcomments.Text);

cmd.ExecuteNonQuery();
con.Close();
con = null;
}
catch (Exception ex)
{
txtFirstName.Text = ex.Message;
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900