please solve my problem .i got syntex erro4sert4date statement in c# with database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mada samy
    New Member
    • Jan 2012
    • 1

    #1

    please solve my problem .i got syntex erro4sert4date statement in c# with database

    please solve my problem .i got syntex erro4sert4date statement in c# with database

    my coding is

    OleDbCommand cmd=new OleDbCommand ();
    cmd.CommandType =CommandType.Te xt ;
    cmd.CommandText ="insert into kount(Id,Name of supervisor,Name of counting asst,Name of micro observer) values('"+txtid .Text +"','"+txtsuper visor.Text +"','"+txtasst. Text+"','"+txto bserver.Text +"')";
    cmd.Connection =con;
    con.Open ();
    cmd.ExecuteNonQ uery ();
    con.Close ();
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    If you have spaces in a field name, you must demarcate it as a field. Different DBMS have different methods of demarcation so you will have to look it up in the documentation for whichever DBMS you're using.

    Comment

    Working...