Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Database > Database General Discussion

Database General Discussion General discussion on database related topics

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 12-02-2008, 7:09 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Oct 2008
Posts: 12
Reputation: 20
penno90 is on a distinguished programming path ahead
Default

Thanks Stonkie, but i already set the relationship to Cascade.

The option for refresh the dataset is greyed out and unticked.
I have inserted break points and checked the dataset visualizer and see that the autonumber from the dataset always remains as assigned by the dataset.
The seed is set to -1 with step of -1 (i think this is the vb default)

i can see here by opening my database after updating, that the new Client is being assigned an autonumber by the DB and that the new Order is being assigned a new autonumber too. the problem is that somewhere along the line the new order is not being associated with the new client in the DB and in the Orders table the Client ID stays as -1.

Am i to understand then, that using Access it is not possible to add a new parent and child at the same time or is there some way of doing this in code?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 12-04-2008, 7:33 AM
cjard's Avatar
VB.NET Forum All-Mighty
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Apr 2006
Age: 65
Posts: 6,442
Reputation: 807
cjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond repute
Default

Quote:
Originally Posted by penno90 View Post
see that the autonumber from the dataset always remains as assigned by the dataset.
Oh dear. The simplest solution would actually be to use a better database. SQLServer comes in a variety of free, small editions, Oracle has a freeware version that leaves Access in the dust and if youre really masochistic, you can take a look at MySQL and PostGresQL

However, you should take a read of this article:
Retrieving Identity or Autonumber Values (ADO.NET)

It describes a way to achieve your goal on access.. Be warned; it's kinda ugly. Sorry I didnt provide this info before: I only just rana google for it because I genuienly thought "Refresh the DataSet" was available on access
__________________
DW1 DW2 DW3 DW4 DNU PQ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 12-04-2008, 7:09 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Oct 2008
Posts: 12
Reputation: 20
penno90 is on a distinguished programming path ahead
Default

Hi cjard

Thanks for the help/advice. I actually started building my database in SQL Server Express 2005 last night to try it out as a pre-emptive solution. As you said the 'Refresh Data Set' option is ticked by default and not greyed out and works perfectly! I had been a bit anxious about trying to learn a new database at the same time as trying to learn VB, but I am so happy to have this working that it was definitely worth it. Since i also eventually want my app to be multi-user this was probably the sensible way to go at an early stage.

Thanks for everyone's help as always

James
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 9:24 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.