Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. inserting data in sql

inserting data in sql

Scheduled Pinned Locked Moved ASP.NET
asp-netdatabasesales
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asmakhan
    wrote on last edited by
    #1

    hi! we are facing problems while inserting data into the table.we are sending u the code which we are trying to run.when we run it we get the message that "you must declare @custmer_id" Me.insertCmd.Connection = New SqlClient.SqlConnection(Me.conString) Me.insertCmd.CommandText = "INSERT INTO [SARAMARIAM\ASPNET].[customer new account] (customer_id, first_name, " & _ "last_name, password, email, [company name], address, [alternative address], city" & _ ", [postal code], country, phone, fax) VALUES (@customer_id, @first_name, @last_n" & _ "ame, @password, @email, @Param1, @address, @Param2, @city, @Param3, @country, @p" & _ "hone, @fax)" myCommand = New SqlClient.SqlCommand(Me.insertCmd.CommandText, Me.insertCmd.Connection) myCommand.Parameters.Add(New SqlClient.SqlParameter("@customer_id", _ SqlDbType.VarChar, 11)) myCommand.Parameters("@customer_id").Value = customer_id looking forward to your reply bye

    P A 2 Replies Last reply
    0
    • A Asmakhan

      hi! we are facing problems while inserting data into the table.we are sending u the code which we are trying to run.when we run it we get the message that "you must declare @custmer_id" Me.insertCmd.Connection = New SqlClient.SqlConnection(Me.conString) Me.insertCmd.CommandText = "INSERT INTO [SARAMARIAM\ASPNET].[customer new account] (customer_id, first_name, " & _ "last_name, password, email, [company name], address, [alternative address], city" & _ ", [postal code], country, phone, fax) VALUES (@customer_id, @first_name, @last_n" & _ "ame, @password, @email, @Param1, @address, @Param2, @city, @Param3, @country, @p" & _ "hone, @fax)" myCommand = New SqlClient.SqlCommand(Me.insertCmd.CommandText, Me.insertCmd.Connection) myCommand.Parameters.Add(New SqlClient.SqlParameter("@customer_id", _ SqlDbType.VarChar, 11)) myCommand.Parameters("@customer_id").Value = customer_id looking forward to your reply bye

      P Offline
      P Offline
      padvit
      wrote on last edited by
      #2

      HI there, Why dont you try with only 2 parameters may be u r going wrong with parameter supply Padvit

      1 Reply Last reply
      0
      • A Asmakhan

        hi! we are facing problems while inserting data into the table.we are sending u the code which we are trying to run.when we run it we get the message that "you must declare @custmer_id" Me.insertCmd.Connection = New SqlClient.SqlConnection(Me.conString) Me.insertCmd.CommandText = "INSERT INTO [SARAMARIAM\ASPNET].[customer new account] (customer_id, first_name, " & _ "last_name, password, email, [company name], address, [alternative address], city" & _ ", [postal code], country, phone, fax) VALUES (@customer_id, @first_name, @last_n" & _ "ame, @password, @email, @Param1, @address, @Param2, @city, @Param3, @country, @p" & _ "hone, @fax)" myCommand = New SqlClient.SqlCommand(Me.insertCmd.CommandText, Me.insertCmd.Connection) myCommand.Parameters.Add(New SqlClient.SqlParameter("@customer_id", _ SqlDbType.VarChar, 11)) myCommand.Parameters("@customer_id").Value = customer_id looking forward to your reply bye

        A Offline
        A Offline
        Alsvha
        wrote on last edited by
        #3

        Well - stupid questions first, but have you infact assigned values to your parameters (all the @'s) somewhere in your code? --------------------------- 127.0.0.1 - Sweet 127.0.0.1

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups