FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister  MasterVB.NET
Visual Basic 2005 .NET Forum
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
newbie SQL insert VB.net Question
 
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Database Programming
View previous topic :: View next topic  
Message
Author
Pete
Newbie
Joined: 26 Jul 2006
Posts: 1

PostPosted: Wed Jul 26, 2006 1:00 am    
Post subject: newbie SQL insert VB.net Question
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Database Programming All times are GMT
Page 1 of 1

 
Jump to:  
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


Archieve

Powered by phpBB © 2001, 2002 phpBB Group, used in Visual Basic 2005 .NET Forum

| Visual Basic .NET Forum | Online Recipe Archiver | Shareware Freeware PAD | Lowongan Kerja | Kamus Online | Health Supply | Digital Camera Review |
Orang Paling Keren

RSS