Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
ExecuteNonQuery command for sql2005
Old 09-07-2006, 02:27 AM ExecuteNonQuery command for sql2005
Experienced Talker

Posts: 34
Trades: 0
I hope you would help me in this problem. I use the code below for executenonquery command for mdb DB.But I do not know the changes I should made when Using SQL2005.
-------------
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=C:\ASPNET20\data\Northwind.mdb"
Dim dbConnection As New OleDbConnection(connectionString)
dbConnection.Open()
Dim commandString As String = "INSERT INTO Employees(FirstName, LastName) " & _
"Values(@FirstName, @LastName)"
Dim dbCommand As New OleDbCommand(commandString, dbConnection)
Dim firstNameParam As New OleDbParameter("@FirstName", OleDbType.VarChar, 10)
firstNameParam.Value = txtFirstName.Text
dbCommand.Parameters.Add(firstNameParam)
Dim lastNameParam As New OleDbParameter("@LastName", OleDbType.VarChar, 20)
LastNameParam.Value = txtLastName.Text
dbCommand.Parameters.Add(LastNameParam)
dbCommand.ExecuteNonQuery()
dbConnection.Close()
--------
s2002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to ExecuteNonQuery command for sql2005
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15813 seconds with 12 queries