473,395 Members | 1,473 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,395 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 15112
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.