Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I dont want to use databinding / (I have solved it with databinding but its not what im looking for)


How do I save changes in cell on Datagridview to my database?

Here is my code to load the data to the Datagridview "MASTERGRID".
VB
Imports System.Data.OleDb
Imports System.ComponentModel
Imports System.Console


Public Class MASTER
    Dim con1 As New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\MyTools\POS\Data\master.mdb")

  Dim sqlsearch As String
            sqlsearch = "SELECT * FROM TBLMaster where status = 'Active'"


            Dim adapter As New OleDbDataAdapter(sqlsearch, con1)

            Dim dt As New DataTable("TBLMASTER")
            adapter.Fill(dt)
            MASTERGRID.DataSource = dt

'I want the data to save to my Table when I am finished edit cell'.
VB
Private Sub MASTERGRID_Cellendedit(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles MASTERGRID.CellEndEdit


end sub
Posted
Updated 29-Nov-11 1:32am
v3
Comments
RaisKazi 29-Nov-11 7:06am    
Edited: 1) Formatting 2) Added "pre" tag.

 
Share this answer
 
It is in c#.try to understand the way.It can be easily done
DatabaseUpdation with datagridview
 
Share this answer
 

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