Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Generated datasets and Formul field in DB

Status
Not open for further replies.

brucegonewild

Programmer
Jan 25, 2008
22
CA
Hi there...
So our company has decided to continue on using the dreadfull generated datasets that come with .NET (instead of using something like entity-spaces etc)...

In any event, I have a field in my DB-Table which is a "Computed field". Meaning, its value is calculated. So obviously when updating or inserting, I shouldn't be touching this field at all.

Here's the problem: When the dumb-generated-data sets create the "Insert", "Update" commands, the forcefully try to write to this field and of course I get an error saying "You cannot update the field, since it's a computed column".

Please let me know if you have any idea in training the dumb-generated-datasets to not update or insert values into certain fields (specially the computed fields!!)

cheers!
 
If you are using the built in datasource objects, then this may be a problem. I would suggest writing your own stored procedured to do you DB calls.
 
Unfortunately at this point, due to VERY strict (and might I add stupid) company-policies, we are not allowed to write Stored-procedures!

the bottom line is I'm limited to Generated datasets. There's absolutly no other option...

Just to save my behind fromg getting fired, I decided to remove the calculated field from the database and use the freakin' auto-generated insert/update functions to pass-in the value... Very stupid and dumb I know... but one stupid policy leads into another dumb technical solution and of course the product at the end becomes that much dumber!!

Anyways if you know of a way please help out.

cheers!
 
What version of the framework are you using? Are you using datasource objects?
 
When the dumb-generated-data sets create the "Insert", "Update" commands
Can't you edit these statements? I admit I don't have much of a clue when it comes to these generated datasets as I have always avoided them, but it seems like you should at least be able to modify the statements they generate.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
yes I can definitly change the code in the designer mode no problem.... however, next time that the dataset has to be regenerated same errors will popup.

Besides our code is in Source Safe... so should one of my colleagues decide to regenerate the dataset, all the designer code changes that I made will be wiped out, the errors will pop back in, and of course the fingures will all be pointing at yours truly! ah the heck with it all... tomorrow's friday... i'll be canned tomorrow anyways.. Friday, "blame all the problems on the programmer and fire him" day!


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top