dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: [help]insert record into MySQL db using ASP.NET???

  1. #1
    Join Date
    Nov 2006
    Posts
    2

    [help]insert record into MySQL db using ASP.NET???

    Hi expert,
    I am having problem in inserting record into MySQL table. It just keep inserting NULL value to the table.
    Below is my code: (I am using ODBC Connection)

    insert into compensation (HP,System,AddDate,Times) values (@HP,@System,@AddDate,1)

    MySQLODBCCmd.Parameters.Add("@HP", txtMobile.Text)
    MySQLODBCCmd.Parameters.Add("@System", SystemList.SelectedValue.ToString)
    MySQLODBCCmd.Parameters.Add("@AddDate", DateAdd(DateInterval.Day, -1, Now()))


    I have tried to use " ? " instead of "@" but the problem is still there...
    Can anyone resolve this problem??

    thanks in advance,

    Suigion

  2. #2
    Join Date
    Nov 2006
    Posts
    2
    Problem is solved...

  3. #3
    Join Date
    Feb 2011
    Posts
    1
    Excellent ... please could you tell me the solution .. I have exactly the same problem .. keep on inserting null values to the database regarding names ... numbers are inserted though !!

    Thank you in advance ..

  4. #4
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Your parameters need to match in your stored procedure so if you are passing in @HP then your stored procedure variable needs to be @HP.

    regards


    Ribs

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles