mohsen200162
دوشنبه 04 بهمن 1389, 21:07 عصر
سلام من این برنامه را که نوشتم ایراد می گیره می شه راهنمایی کنید
privatevoid UpdatePerson(int dellid )
{
SqlConnection cnn = newSqlConnection();
cnn.ConnectionString = WebConfigurationManager.ConnectionStrings["mysql"].ConnectionString;
SqlCommand cmd = newSqlCommand();
cmd.Connection = cnn;
string MyCommandText = string.Format("Update lighting Set Object = N'{0}' ,Title = {1} where id={2}", textfull.Text, texttitel.Text, dellid);
cmd.CommandText = MyCommandText;
try
{
cnn.Open();
cmd.ExecuteNonQuery();
Label6.Text = " ";
}
catch (SqlException ex)
{
Trace.Warn(ex.Message);
Label6.Text = " . ";
}
catch (Exception ex)
{
Trace.Write(ex.Message);
Label6.Text = " ! .";
}
finally
{
cnn.Close();
}
}
این خطا رو می ده
Incorrect syntax near 'دستگاه'.
privatevoid UpdatePerson(int dellid )
{
SqlConnection cnn = newSqlConnection();
cnn.ConnectionString = WebConfigurationManager.ConnectionStrings["mysql"].ConnectionString;
SqlCommand cmd = newSqlCommand();
cmd.Connection = cnn;
string MyCommandText = string.Format("Update lighting Set Object = N'{0}' ,Title = {1} where id={2}", textfull.Text, texttitel.Text, dellid);
cmd.CommandText = MyCommandText;
try
{
cnn.Open();
cmd.ExecuteNonQuery();
Label6.Text = " ";
}
catch (SqlException ex)
{
Trace.Warn(ex.Message);
Label6.Text = " . ";
}
catch (Exception ex)
{
Trace.Write(ex.Message);
Label6.Text = " ! .";
}
finally
{
cnn.Close();
}
}
این خطا رو می ده
Incorrect syntax near 'دستگاه'.