INSERT function in ASP.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zaiena
    New Member
    • Jun 2007
    • 20

    #1

    INSERT function in ASP.NET

    hi
    i'm using asp.net(vb lamguage),and trying to write an sql statemnet to insert values in my table,i'have tried many ways but no one work as i need tere is alawya an error.i'm also using componentart tools and try to insert values in the table to appear at grid.
    here is my last one
    cmd.CommandText = "insert into std_t(std_no,st d_name)values(@ std_no,@std_nam e)"

    can any one help or have another ideas.
    thanx lot
  • JamieHowarth0
    Recognized Expert Contributor
    • May 2007
    • 537

    #2
    Hi zaiena,

    Your question is a .NET-specific one and so has been moved to the .NET Forum.

    With regard to INSERT statements, I'm a newbie to ASP.NET but I believe that if you use a DataSet and add an INSERT function to the TableAdapter then you can call that from your ASP.NET code (if you're using Visual Web Developer).

    Best regards,

    medicineworker

    Comment

    • jaz215
      New Member
      • Nov 2007
      • 55

      #3
      Originally posted by zaiena
      hi
      i'm using asp.net(vb lamguage),and trying to write an sql statemnet to insert values in my table,i'have tried many ways but no one work as i need tere is alawya an error.i'm also using componentart tools and try to insert values in the table to appear at grid.
      here is my last one
      cmd.CommandText = "insert into std_t(std_no,st d_name)values(@ std_no,@std_nam e)"

      can any one help or have another ideas.
      thanx lot
      you talked about errors, maybe we could see about your errors and that we can solve it from there :P
      could you note what are you using to develop asp so we can better help you..
      regarding you query have you tried using:

      Code:
      comInsert.CommandText = "Insert into [Table] values " & _
                                          "('" & firstvalue & "', " & _
                                          "'" & value2 & "', " & _
                                          "'" & value3 & "', " & _
                                          "'" & value4 & "', " & _
                                          "'" & lastvalue & "')"
      
      comInsert.ExecuteNonQuery()

      Comment

      Working...