|
I think he might mean Entity Framework 4.1. Just a guess.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
You might start here and read the documentation: Tutorial: Code First with EF 4.1[^]. Maynot have the answer but might point you in the right direction.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
To add to the rest of the advice; It's a bad idea to tinker with the seed-values. You should NOT be wasting time on having them start from a particular range (like 1).
Why? Because the artificial key does not hold information, it is merely a link to another record. It's contents should not be relevant outside that purpose. Ever.
Second, having an artificial key does not mean that you no longer need to find the "real" primary key, the combination of (non-identity) fields that make the record unique. Why? Because the user needs to be able to differentiate between the records, based on something else than an artificial identity that holds no information.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I have someone who stores a modest amount of data by file path in different directorys on a network share. The path to the network share identifies the data. They now want to store some data in a database and whould like to store the data in different database files in each of the shared network folders. My question is, is this even a remotely good idea.
|
|
|
|
|
Until they tell you the reason behind it I'd say: Not even a remotely good idea.
|
|
|
|
|
Unless there is a very good reason, it sounds like a moderately horrible idea to me.
|
|
|
|
|
Thanks, I think the reason they want to do this is that it would tie into their existing scheme for backing up data.
|
|
|
|
|
John Robert Wilk wrote: existing scheme for backing up data
I would argue that creating and backing up 50 files uneccessarily is 50 times worse than backing up one file...
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Thanks guys I appreciate I'm not very confident when it comes to databases.
|
|
|
|
|
John Robert Wilk wrote: I'm not very confident
When in doubt just stamp their request, "Disapproved. Resubmit in 90 days for further disapproval."
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
John Robert Wilk wrote: . They now want to store some data in a database and whould like to store the
data in different database files in each of the shared network folders.
Certainly doesn't suggest a database which is performant.
And what happens when one of those servers goes down? It means the database would disappear. Might be interesting to see if MS SQL Server would even let you create the DB files on a shared folder. If it won't then that would rule it out completely. If it does then I would next test what happens to the database server if the share goes away when the server is running.
You know that they can create it in different directories right? Wouldn't that be sufficient? You might also mention that there are other back up strategies possible with the database rather than just doing a file copy.
|
|
|
|
|
To be honest I think they are looking for the easiest way out on their end which would be to do nothing and continue with the current process as is.
|
|
|
|
|
If I was getting paid for it and they really wanted to do it I would still try it out in MS SQL Server with the shared directories just to see what would happen. It sounds like an interesting experiment.
|
|
|
|
|
John Robert Wilk wrote: My question is, is this even a remotely good idea.
It merely proves that someone does not understand what a database-server is, and how it's being used. Whoever came with the proposal should not be doing any work outside of Microsoft Access.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I have a stored procedure that is updating, but causing an insert error. Never seen that before.
Update MyCoolTable
Set MyValue=@passedInValue, SecondaryIdentifier=@secondID
WHERE PrimaryID = @primaryID
There is an index on (SecondaryID,PrimaryID) that is being violated and I'm not sure why. :
Quote: Cannot insert duplicate key in object 'dbo.MyCoolTable'. The duplicate key value is (secondaryIDValue, primaryIDValue).
Why is it trying to insert on an update?
--edit--
Nevermind, I figured out what was happening (though not from the error message). It can't update the secondaryID because there can be more than one, which is what is causing the problem. I guess when they wrote it that could never ever happen.
If it moves, compile it
modified 17-Sep-12 13:41pm.
|
|
|
|
|
loctrice wrote: I guess when they wrote it that could never ever happen
You might wanna post this a tip/trick. Maybe in this way it'll get searchable more easily by others having the same problem (and hopefully avoid another This is failing dunno why plz provide codez Q&A question)
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|
|
Andrei Straut wrote: avoid another This is failing dunno why plz provide codez
was there something wrong with my question? I know it was a dumb question but my brain was just slow today. I guess I should/could have waited longer to post.
If it moves, compile it
|
|
|
|
|
Oh, sorry for not making it clearer. I wasn't referring to your question (and I did upvote it), that was posted just fine from my point of view. I was referring to someone else having this problem in the future and posting in the manner I described.
Didn't think you'd think I'd think that of your question (pun intended).
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|
|
Andrei Straut wrote: Oh, sorry for not making it clearer.
my fault. glad we got it cleared up
If it moves, compile it
|
|
|
|
|
how to add pictures and videos in mySQL???plz help me
|
|
|
|
|
It's very simple.
You try a Google search[^] first, then after you've done that and got some sort of idea of what you need to do you start doing it, and then when and if you get stuck, you come back, you explain your problem clearly and with detail (while providing the smallest possible amount of relevant code), and someone will probably give you an idea. This is how it works.
Until then, I am downvoting your question
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|
|
Snarky, bitchy and oh so polite - I love have another 5
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
10x. I hope I'm making my point across while repeating myself over and over again. If only they'd listen...
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|
|
Andrei Straut wrote: If only they'd listen. You can try shouting a bit louder, but that just gets you a sore throat.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Chris doesn't like shouting in the Q&A / programming forums
I do feel a really strong urge to do it however
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|