473,804 Members | 2,034 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.Da taSource=ds.Tab les[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 2514
See inline:

"weird0" <am********@gma il.comwrote in message
news:11******** *************@5 7g2000hsv.googl egroups.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.Da taSource=ds.Tab les[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.co m
Jul 13 '07 #2

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

Similar topics

4
2001
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 with each row of the first table. I am able to display the first table's data in one of the DataGridView controls - DatgaGridView_A. What I want to do, but don't know how, is to select a row from the DataGridView_A and have the data associated...
7
2895
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 not sure? The other think I saw was to implement IEditable? How would I do that? Where in my code woudl I do that considering I am not creating the DataGridView via code? I know this is probably the easist thing to do I just don't know how?...
3
14584
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 information from the sender object or the EventArgs? How? Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.Click Console.WriteLine("row number of cell is ?")
2
24562
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 you update after closing the grid/form, etc.? Also, can you tell me the best book to buy that fully explains the DataGridView control? Thanks.
5
1992
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 names") and then displays all records with company names in a datagridview. Once the information has been binded to the datagridview control, I allow the user to select all records that are not companies, for example, during the search the key word...
2
2236
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. -------------------------------------- My Problem is this: -------------------------------------- I have 2 forms. The first form contains a DataGridView and a button. The DataGridView is bound to an access database, and loads at form_load. The second form contains several...
2
11634
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, my whole appliation freezes with any response. After a lot of time, it comes back. If I set the DataSource to null before changing the data and set it back after changing. There' s no problem. But I lost the status of the DataGridView, like...
5
3007
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 database. I'm not sure how to do this! Any ideas? Thanks in advance all.... Sreeni
5
2917
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 best to do it this way, calling the update stored procedure for every update? Or should I be loading this data into a staging table, and if all goes well do the 'Real' Update. Or put this into a data adapter and update from that? The application...
0
9711
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9591
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10594
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10087
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6861
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
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 we have to send another system

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.