473,498 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating data to datagridview

How can i update the data in my database directly through
datagridview....? Can anyone tell me the appropriate links and what is
the exact event in datagridview that handles it and some explanation
abut how to handle it.

what does ds.Tables[0]...ds.Tables[string name] return by the way?
What does it mean?

DatagridView.DataSource=ds.Tables[0]; // one of the statement in my
code Why?

What is a DAtaSet and DataAdapter? Some links plz.

I have successfully displayed data in the datagridview.

Jul 13 '07 #1
1 2480
See inline:

"weird0" <am********@gmail.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
How can i update the data in my database directly through
datagridview....? Can anyone tell me the appropriate links and what is
the exact event in datagridview that handles it and some explanation
abut how to handle it.
You can't do it. Assuming you are bound to a DataSet/DataTable, at the
point you want to update the database (that's up to you to decide when), you
have to pass the changed DataSet/DataTable through a data adapter,
performing the update yourself.
what does ds.Tables[0]...ds.Tables[string name] return by the way?
What does it mean?
Assuming ds is a DataSet, ds.Tables[0] will return the first DataTable
instance that the DataSet stores. The call to the string indexer on the
Tables will return the DataTable with that name.
DatagridView.DataSource=ds.Tables[0]; // one of the statement in my
code Why?
I don't know what you mean by this.
What is a DAtaSet and DataAdapter? Some links plz.
A DataSet is a set of DataTables, along with any relations
(DataRelation) between those tables. It is an in-memory representation of
data.

A DataAdapter will take a DataSet/DataTable and based on the changes
made to it, iterate through the changes and execute a command against the
underlying data source for each change in the DataTable.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
Jul 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1973
by: Steve Teeples | last post by:
I have a form with two DataGridView controls. The form has linked to it an Access database with just two tables. The second table contains unique "child" data having a one-to-one relationship...
7
2876
by: Greg P | last post by:
I'm new to VS2005 and want to simply update my data with the dataGridView that was generated when I draged my query from the Data Sources Pane. I think I may need to create a Data Adaptor but I'm...
3
14547
by: Rich | last post by:
Hello, If I want to update data displayed in a datagrideview/datagridview cell, how can I determine what cell I am updating? I am looking at the click event below, for example. Can I get...
2
24507
by: bob | last post by:
Can anyone tell me the best way to update a dataset while it is being edited/viewed in the DataGridView control? Is this something that should be inserted into one of the grid's events? or should...
5
1961
by: JimmyKoolPantz | last post by:
Situation: I am writing a program that opens up a data file (file ext .dbf), imports the information into a dataset. The program also, searches through the dataset for key words ("company...
2
2211
by: snowdog17 | last post by:
Hello, I am a student and I need help with my VB task. I am currently using VB 2005 Express and I am fairly new to it, although I have programed in Delphi before....
2
11520
by: hjin | last post by:
DataGridView takes very much time if I update a lot of data I have a DataGridView which has a DataSource (a DataTable) of 3000 rows. If I want to update one column of every rows in the DataTable,...
5
2993
by: sreenu123 | last post by:
Hello All, Here's what I'm trying to do: I'm loading a datagridview with data from a dataset. I want to be able to update data in the datagridview and then save changes back to the dataset or...
5
2890
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it...
0
7126
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
7168
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,...
1
6891
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
7381
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...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.