how to insert into sql db in vb.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • soorsha
    New Member
    • Sep 2006
    • 1

    how to insert into sql db in vb.net

    hello
    i'm a biginer in vb.net.i'm trying to do a personaly project for a campany.
    i want to know the best way to insert into db.also,my database is sql2000.
    i have problem wih insert statment.plz help me.
  • sainin
    New Member
    • Sep 2006
    • 13

    #2
    Please be more specific with the error?? Cut paste the code/error message if needed.

    Comment

    • Anil Prasad
      New Member
      • Sep 2006
      • 3

      #3
      [QUOTE=soorsha]hello
      let me tell u the different way to insert into the database intead of insert command.it is most commonly used

      this is using the disconnected model
      where u have to create sqldataapdapter and dataset.
      0.) Define Data row
      dim drow as dataRow
      1. add new row
      drow=datasetnam e.tables("<tabl e name>").newRow( )

      2.Assign values to new row.
      drow("Field name of Table")= values("What ever text box")

      3.) Add row to the dataset

      datasetname.tab les("<table name>").rows.ad d(drow)

      4.) finaly update the datadapter by,,
      dataadaptername .update("<datas et name>","Table Name")

      Comment

      Working...