|
-
Apr 3rd, 2003, 03:20 AM
#1
Thread Starter
Lively Member
Databinding Question
I have two text boxes that are bound to a dataset, there is also a Sqlconnection, SqlDataadapter in use. VB.Net generated the Insert, Update and Delete statements for the dataset but I cant figure out how to get the new data out of the textboxes and into the database. This is the code that was generated by Visual Studio. Thanks for the help.
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO dbo.Users(UserName, UserPassword) VALUES (@UserName, @UserPassword); " & _
"SELECT UserName, UserPassword FROM dbo.Users WHERE (UserName = @UserName)"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.VarChar, 20, "UserName"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@UserPassword", System.Data.SqlDbType.VarChar, 20, "UserPassword"))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|