Carmel,
Couldn't reply to your thread so here's another.
First, here's your original message...
UPDATE MySql database
Posted: 03 May 2003 03:52 PM
I am trying to update an entry in my database when i click a button on my windows form:
Here is my code:
<CODE>
private void modify_btn_Click(object sender, System.EventArgs e)
{
string conn_str = "DRIVER={MySQL};" +
"SERVER=localhost;" + "DATABASE=HouseHunters;" +
"UID=root;" +
"PASSWORD=;";
OdbcConnection conn = new OdbcConnection(conn_str);
if(MessageBox.Show("You are about to modify this Property\nAre you sure you wish to continute?", "Delete Record?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
query = "UPDATE propertylisting set City = '" + selectCity_tb.Text + "', location = '"+ location_tb.Text+" WHERE propertyID = '" + propertyID_tb.Text + "'";
modifyCommand = new OdbcCommand(query, conn); modifyCommand.Connection.Open();
///////// ERROR OCCURS HERE
modifyCommand.ExecuteNonQuery();
modifyCommand.Connection.Close();
}
}
</CODE>
I have tried debuggin it and the error occurs where I have commented.
Any ideas?
Check your SQL syntax, I believe you've got a single quote missing after...
<CODE>
location_tb.Text+"
</CODE>

1 answers
This post was imported from csharpfriends, if you have a similiar question please ask it again.
All previous members have been migrated, hope you enjoy the new platform!