Click here to Skip to main content
14,735,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all
I have a script to update the value from datagridview to database
I do use a button insert ToolStripButton
but not working
hope people to help
thank !
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

       conn = New SqlConnection("")
       conn.Open()
       Dim query As [String] = "SELECT * FROM dtaTraLoiChoVanBan"
       da = New SqlDataAdapter(query, conn)
       Dim cb As New SqlCommandBuilder(da)
       dt = New DataTable()
       da.Fill(dt)
       C1FlexGrid1.DataSource = dt
       conn.Close()

   End Sub
 Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked
       Select Case e.ClickedItem.Name
           Case "ToolStripButton1" '---> button insert
               da.Update(dt)

       End Select
   End Sub
Posted
Comments
joshrduncan2012 23-Apr-14 12:58pm
   
"not working" doesn't help us.

Are you getting any errors, if so, what line is it pointing to? If not, what kind of output are you getting?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900