Skip to main content
GameDev.net gamedev.net
🔒 Locked

Database Problem...

Started by Elwren Feb 1, 2006 at 2:38 PM 0 replies 600+ views
Original Post
Elwren
Elwren
Hey, I am using ADO.net to insert/delete data in my Access database in a program I have. I am also using the OleDbCommandBuilder to automatically generate the INSERT/DELETE/UPDATE commands. The problem is: When I am trying to insert a row into one of my tables, it says "Dynamic SQL generation can not be used on multiple base tables". I believe this is because the table I am trying to insert a row into, has a foreign key in it that comes from a different table. I presume that is what the error means by 'multiple base table'. I'm not exactly sure but I guess the problem is with the OleDbCommandBuilder. My first question is: do most people use the CommandBuilders to generate the sql commands automatically? Secondly, if I don't use the CommandBuilder, how exactly do I insert the row and have it updated into my actual Access database. Do I have to set the InsertCommand property of my DataAdapter for every table and then do something with that? Thanks for the help. If you know how to fix the issue with 'multiple base tables' and my CommandBuilder, that also would be great. Thanks
graveyard filla
graveyard filla
I've never used CommandBuilder so I can't help with that... but personally I just use Commands w/ parameterized queries for small stuff. If it is for a decent sized project, putting all actual DB logic into stored procedures is a good idea.
FTA, my 2D futuristic action MMORPG

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.