473,387 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

update database when datagridview changes

11
here's my code in filling a datagridview,which i retrieve from database mysql,

Expand|Select|Wrap|Line Numbers
  1.         dim sql as String
  2.         sql = "SELECT * FROM table_user"
  3.         Dim myData As New DataTable
  4.  
  5.         comm.Connection = conn
  6.         conn.Open()
  7.  
  8.        ' comm.CommandType = CommandType.Text
  9.         comm.CommandText = sql
  10.         myAdapter.SelectCommand = comm
  11.         myAdapter.Fill(myData)
  12.  
  13.  
  14.        DataGridView1.DataSource = myData
  15.  
  16.  
So here's my question(just as you read from my title),
how to update database when values in the datagrid change?

please help,
arjel
Feb 4 '09 #1
1 15109
adsaca
11
i've already found a solution to my problem, and here's what i did.

Expand|Select|Wrap|Line Numbers
  1.  
  2. myAdapter.Update(myData , "table_user")
  3.  
  4.  
Feb 4 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: thomasp | last post by:
I know this is a vague question, but I am not sure what information to give. I am using VB2005 beta and the datagridview is pulling data from one of three tables in an Access database. For some...
1
by: Joaquin | last post by:
OK, I hate myself for asking this, it's the worst question I have ever asked but it's worse not to ask: ¿How do I update a datatable in vs 2005? I mean, I am using a typed dataset, a...
5
by: explode | last post by:
I made a procedure Public Sub Novo(ByVal nova1 As String, ByVal nova2 As String) that creates a new oledbDataAdapter with insert update select and delete commads. I also added that commands can...
3
by: =?Utf-8?B?THVib21pcg==?= | last post by:
Hi, I have a DataGridView that displays data from one table from database. I didn’t implement any my code, I just used wizard to do all the work with DatagridView populating. Visual Studio...
1
by: gaya12 | last post by:
I have a table called Student in a SQL databse.. I have to create a simple windows application in C# to Retrieve that table for the following functions.. 1.Add Data 2.Update Data 3.View Data ...
3
by: sampalmer21 | last post by:
Hi, If I update a cell in the DataGridView control, I use the DataAdapter.Update(DataTable) method to update the database, but when I restart the application my changes are not in the database....
0
by: sonia.sardana | last post by:
I m using ADODB+ SQL. Mine SQL table is create database student use student create table stu_table(roll int primary key,name varchar(10), marks int)
1
by: Arved Sandstrom | last post by:
This seems to be something so simple that none of the hundred-odd tutorials and forum threads that I have looked at (:-)) apparently thinks it's a problem. In a nutshell, I have two...
1
by: adsaca | last post by:
database: MySQL i use connector i have two tables with the following contents: tbl_user_info user_id(Primary Key) fname lname
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.