asked on
ASKER
Private Sub frm_Users_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim conn As New SqlConnection(")
Dim cmd As New SqlCommand("proc_UserAccess_All", conn)
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandTimeout = 30
conn.Open()
da = New SqlDataAdapter(cmd)
Dim builder As SqlCommandBuilder = New SqlCommandBuilder(da)
ds = New DataSet()
da.Fill(ds, "tbl_Users")
BindingSource1.DataSource = ds.Tables("tbl_Users")
BindingNavigator1.BindingSource = BindingSource1
cmd.Dispose()
cmd = Nothing
conn.Close()
conn = Nothing
txtWindowsUsername.DataBindings.Add("Text", BindingSource1, "UserID")
txtName.DataBindings.Add("Text", BindingSource1, "Username")
cbActive.DataBindings.Add("Checked", BindingSource1, "Active")
End Sub
Private Sub ToolStripButton1_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripButton1.Click
Me.Validate()
Me.da.Update(Me.ds.Tables("tbl_Users"))
Me.ds.AcceptChanges()
End Sub
ASKER
Do i need to add an addition stored procedure for the update command?
Yes you do. ASKER
ASKER
Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,
TRUSTED BY
http://support.microsoft.com/kb/301248
The general procedure is same:
1: you define a connection and set its connecton string and open it
2: you define a command object and set its text .
3: Now you can run this command:
For example:
Dim cmdDB As New SqlCommand("Update MyTable Set Age=6 where name="James"