|
|
| View previous topic :: View next topic |
| Message |
|
Author
|
Pete
Newbie
|
Joined: 26 Jul 2006
Posts: 1
|
|
Posted: Wed Jul 26, 2006 1:00 am
Post subject: newbie SQL insert VB.net Question |
|
|
I am trying to develop some code to allow me to enter a new record into an MSSQL table (code is below). Currently this code inserts a record and gives it a new autonumber but does not populate the Title,
Firstname or Secondname fields.
Any advise greatly appreciated.
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
localsource.InsertParameters.Add("@ID", 3)
localsource.InsertParameters.Add("@Title",
System.Data.SqlDbType.Text, "ggg")
localsource.InsertParameters.Add("@Firstname",
System.Data.SqlDbType.Text, "ggg")
localsource.InsertParameters.Add("@Secondname",
System.Data.SqlDbType.Text, "ggg")
Try
localsource.Insert()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|