Front Office Football Central  

Go Back   Front Office Football Central > Archives > FOFC Archive
Register FAQ Members List Calendar Mark Forums Read Statistics

Reply
 
Thread Tools
Old 06-26-2005, 03:09 PM   #1
gstelmack
Pro Starter
 
Join Date: Oct 2000
Location: Cary, NC
ADO.NET 2.0 Beta 2 Question

I'm trying to do a bit of ADO.NET programming using C# in the Visual Studio.NET 2005 Beta 2 edition. I've got an Access database that I am reading into a DataGridView that displays all the rows nicely. My problem is that I cannot actually CHANGE the contents of the database. I'm attempting to manually add and delete rows, but while I can get the DataSet to change (and the corresponding GridView to update), I can't get my changes committed back to the database. Calling "AcceptAllChanges" does not seem to have any effect. Deleting rows within the GridView has no effect either.

This is my first foray into ADO.NET, so I'm probably missing something obvious (if not running into a bug in Beta 2). My only book at the moment is "Introducing Microsoft ASP.NET 2.0", so it's ADO chapters are geared more towards web development.

I figure I'll come across the answer within 15 minutes of posting this (half the time this is the best way to figure something out ), but if anyone has more experience with ADO.NET that can point me in the right direction, I'd be grateful.
__________________
-- Greg
-- Author of various FOF utilities

gstelmack is offline   Reply With Quote
Old 06-26-2005, 03:15 PM   #2
Joe
Pro Starter
 
Join Date: Jun 2004
Location: Minneapolis
in english please?
Joe is offline   Reply With Quote
Old 06-26-2005, 03:46 PM   #3
gstelmack
Pro Starter
 
Join Date: Oct 2000
Location: Cary, NC
Quote:
Originally Posted by George W Bush
in english please?

I'm trying to get my FBCB -> TPB draft file converter working, but I can't save out any of the players.
__________________
-- Greg
-- Author of various FOF utilities
gstelmack is offline   Reply With Quote
Old 06-26-2005, 09:51 PM   #4
Fidatelo
Pro Starter
 
Join Date: Nov 2002
Location: Winnipeg, MB
You need to use a DataAdapter and write code to handle the update statement (either to call a stored proc, generate update SQL, or whatever). Then call the DataAdapter and pass in the DataSet.

Here is a link that may help, although it's 1.1 and I'm not certain what has changed to 2.0.

http://www.devx.com/vb2themax/Tip/19429
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime."

Last edited by Fidatelo : 06-26-2005 at 09:51 PM.
Fidatelo is offline   Reply With Quote
Old 06-27-2005, 10:08 AM   #5
gstelmack
Pro Starter
 
Join Date: Oct 2000
Location: Cary, NC
I've got an Adapter, just for some reason changes in the GridView and the DataSet are not being propagated to the database through the Adapter. If I call the Adapter.Insert method directly, the database is updated.

I've created most of this through the wizards in VS.NET 2005, only weird thing was that I had to manually create a DELETE query. But there appears to be one other piece missing, as at the very least I expected manual editing in the GridView to update the database.
__________________
-- Greg
-- Author of various FOF utilities
gstelmack is offline   Reply With Quote
Old 06-27-2005, 10:26 AM   #6
gstelmack
Pro Starter
 
Join Date: Oct 2000
Location: Cary, NC
Okay, I've got this working by manually making the database calls on the Adapter. That's good enough for me for the moment, maybe later I can figure out the GridView bits...
__________________
-- Greg
-- Author of various FOF utilities
gstelmack is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -5. The time now is 05:06 AM.



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.