473,320 Members | 2,111 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,320 software developers and data experts.

DataGrid updates in Windows Forms - Am I going crazy?

I am trying to just load a datagrid and save the changes. I have
googled and sweated over this, and thanks to Microsoft I have much
pain. Can anyone help?

I am populating the DataGrid with NP, using

DataSet thisDS = getDS(thisDBName); // returns dataset based on an SQL
query
DataGrid1.SetDataBinding(thisDS,"Part"); // put data into datagrid

That works fine. But when I try and update, I keep a jumble of errors.
The basic issue is that my grid that is defined at design time and
populated via an SQL query (above), has no DataSet as a source in grid
properties. So I need some code to pull out the data from the grid.

I tried getting the design time oledbadapators working, but I got
nowhere.

Google is great, but you find you keep hitting the same pages on
different searches.

Can anyone help? What I need is just some simple code for Windows
Forms using mdb files to populate the datagrid using joins from tables
and then update values. I would like also to put some drop down boxes
in the cells. I can this on my Web server using dataitems.

Anyway, my head hurts and I feel like I am running a small circle!
Also I starting to think google really only 10 pages in its index and
the rest are spoof pages!

Jun 16 '07 #1
1 1426
Locigian,

The thing you have to realize is that what you are showing in the grid
is completely disconnected from the underlying data source. When you call
SetDataBinding, the DataSource and the DataMember properties are set
appropriately. You can get the underlying dataset from the DataSource
property, in this case.

Once you have that, you can pass the dataset to an OleDbDataAdapter
(which you will have to set up based on the underlying data) so that you can
update the underlying tables.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Logician" <sa***@logicians.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
>I am trying to just load a datagrid and save the changes. I have
googled and sweated over this, and thanks to Microsoft I have much
pain. Can anyone help?

I am populating the DataGrid with NP, using

DataSet thisDS = getDS(thisDBName); // returns dataset based on an SQL
query
DataGrid1.SetDataBinding(thisDS,"Part"); // put data into datagrid

That works fine. But when I try and update, I keep a jumble of errors.
The basic issue is that my grid that is defined at design time and
populated via an SQL query (above), has no DataSet as a source in grid
properties. So I need some code to pull out the data from the grid.

I tried getting the design time oledbadapators working, but I got
nowhere.

Google is great, but you find you keep hitting the same pages on
different searches.

Can anyone help? What I need is just some simple code for Windows
Forms using mdb files to populate the datagrid using joins from tables
and then update values. I would like also to put some drop down boxes
in the cells. I can this on my Web server using dataitems.

Anyway, my head hurts and I feel like I am running a small circle!
Also I starting to think google really only 10 pages in its index and
the rest are spoof pages!

Jun 18 '07 #2

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

Similar topics

2
by: Raj | last post by:
Hi, When we are sorting the DataGrid Boolean column the grid is becoming redcross. I have my own PPMIPDataGridBoolColumn class inherited from System.Windows.Forms.DataGridBoolColumn. In this...
0
by: Dave | last post by:
Tried posting in the Winform Forum without much luck, so posting here... After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is...
7
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output...
2
by: Flack | last post by:
I have a DataGrid and a DataTable. When my form loads I create the DataTable with the appropriate columns and use it for the DataGrids.DataSource. Later on in my app, I alter the DataTable: ...
0
by: Marcus Kwok | last post by:
I am having a weird problem with my DataGrid that is bound to an ArrayList. My situation is as follows: I have two DataGrids on a modal form. The top grid populates an ArrayList from a file,...
1
by: DaveS | last post by:
I am trying to capture the mouse click position in a datagrid but I get the following compilation error: Compiler Error Message: BC30002: Type 'System.Windows.Forms.MouseEventArgs' is not...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
4
by: Ty | last post by:
Hi all Short version of my problem: i have a Datagrid (Flexgrid from ComponentOne) with a Datatable as source. I need to search a row in the datatable, using a primary key column in the...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.