Hi i was using stored procedure in SQL Server to pass parameters to the query , but now I'm changing my database to ms access and it's my first time to deal with.
how can i pass byte[] to sql query ? bacause i got this error Syntax error (missing operator) in query expression 'System.Byte[]'.
this is my code
public static int EditWhois(object ID,object Image, object Ranswer, object Fanswer1, object Fanswer2, object Fanswer3)
{
int result = 0;
String sql = "UPDATE Whois SET [Image]="+@Image+", Ranswer=" + Ranswer + ", Fanswer1=" + Fanswer1 + ",Fanswer2=" + Fanswer2 + ",Fanswer3=" + Fanswer3 + " WHERE ID=" + ID;
System.Windows.Forms.MessageBox.Show(sql);
cmd = new OleDbCommand(sql, con);
//cmd.Parameters.AddWithValue("@ID", ID);
//cmd.Parameters.AddWithValue("@Image", Image);
//cmd.Parameters.AddWithValue("@Ranswer", Ranswer);
//cmd.Parameters.AddWithValue("@Fanswer1", Fanswer1);
//cmd.Parameters.AddWithValue("@Fanswer2", Fanswer2);
//cmd.Parameters.AddWithValue("@Fanswer3", Fanswer3);
if (con.State != ConnectionState.Open)
{
con.Open();
result = cmd.ExecuteNonQuery();
con.Close();
}
return result;
}
object
? Which one's abyte[]
? – BoltClock♦