SQL Statement

  • 14 years ago

    Dim

    mycomand As SqlCommand = New SqlCommand("insert credit ,number_of_account,name_of_account into ledger", myconn)

    mycomand.ExecuteNonQuery()

    there are some error

    any one can help me

  • 14 years ago

    That SQL code is completely wrong.  I think a tutorial is in order:

    http://www.geocities.com/SiliconValley/Vista/2207/sql1.html



  • 14 years ago

    It is like "insert into TABLENAME (COLUMNNAME1, COLUMNNAME2 ..etc) values (VALUEFORCOLUMN1, FOR2 ...etc)" pay attention which columns are not null type, you must then include them in your command... so if I had table
    customers
    {
     c1.name = "id" :: automatic number not null
     c2.name = "name" :: not null
     c3.name = "surname" :: not null
    }

    it would be enough to proceede "insert into customers(name,surname) values ('Me','The Biggest')"
    to add new customer called Me The Biggest...










Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens