473,549 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple mechanism for updating database with data from bound datagrid

I'm using the Framework 1.1, so I don't have access to the new
DataGridView object.

What I'm wondering is, is there a really simple way to bind a plain
datagrid to a database in such a way that changes made to cells in the
datagrid call an update on the corresoonding data within a database?
I've looked in vain for a really simple way to do this with minimal
coding, but I'm coming to the conclusion that I will have to trap the
events of the datagrid and do all the dirty work myself.

Any suggestions would be very appreciated.

Greg.

Feb 15 '06 #1
2 1665
Greg,

You are pretty much right. The data model of .NET is a disconnected
one, so if you want to update the database (or know when it is updated), you
will need to put that mechanism in yourself.

As for updating, yes, you will have to determine when the data grid is
changed (you are better off connecting to the dataset itself, and catching
the events on there) and then updating the back end appropriately.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Greg" <gr************ *@yahoo.co.uk> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
I'm using the Framework 1.1, so I don't have access to the new
DataGridView object.

What I'm wondering is, is there a really simple way to bind a plain
datagrid to a database in such a way that changes made to cells in the
datagrid call an update on the corresoonding data within a database?
I've looked in vain for a really simple way to do this with minimal
coding, but I'm coming to the conclusion that I will have to trap the
events of the datagrid and do all the dirty work myself.

Any suggestions would be very appreciated.

Greg.

Feb 15 '06 #2
Nicolas,

Thanks for that - that has saved me a lot of time doing more searching!
I'm not too daunted by the solution - I just needed to check that I
wasn't barking up the wrong tree!

Greg.

Feb 15 '06 #3

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

Similar topics

9
1638
by: Pam Ammond | last post by:
After clicking btnDeleteSize_Click in frmSize, I move to frmSizeDelete, allow deleting a Size using a datagrid, and then return to frmSize and want to update the datagrid in frmSize to reflect the deletion. I can't figure out how to get the datagrid in frmSize updated, although the datagrid in frmSizeDelete shows the deletion properly. In...
5
2015
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated one row, all of them were updated so i immediatelly figured out that i have to include the id of every entry in the update statement. This is where...
1
1324
by: Geraldine Hobley | last post by:
hello, I have put thisup b4, but I think that people have misunderstood the problem, so I will make it clearer. I have a problem updating a dataset that is bound to a datagrid. The code that I use to set up the grid dgsimple to the dataset Mydataset and the table "Orders" is as below (see bottom of page) My problem is that I can change...
3
1259
by: lemuel | last post by:
hello everyone. i'm new here at this site so sorry if i may sound like a newb (i really am) i'm using C# by the way. i have a datagrid in my windows form and that datagrid's datasource is bound to a specific database using a MySQLConnection. my problem now is that i want a user to actually enter some data into the datagrid and the data...
0
7459
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...
0
7726
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. ...
0
7819
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...
1
5377
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5097
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...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1953
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
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
772
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.