UPDATE c# MySQL syn -


i want update table time difference between 2 events. i've implemented code:

timespan ts = vett[0] - vett[1];  mysqlcommand cmdup = new mysqlcommand();  cmdup.commandtext = "update event_move set diff_time=" + ts + "where id_event_move=" + id_move[0]; cmdup.connection = myconn; myconn.open();  cmdup.executenonquery();  myconn.close(); 

my visual studio 2010 indicates syntax error @ line cmdup.commandtext = ...

might me? in advance

the source of mistake missing space giovanni says. tip use string.format method.

cmdup.commandtext = string.format("update event_move set diff_time={0} id_event_move={1}", ts, id_move[0]); 

have used this, spot missing space immediately.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -