|
Stupid thing. Couldn't find the city I'm in, and tried to claim the nearest city was a town somewhere else.
Some men are born mediocre, some men achieve mediocrity, and some men have mediocrity thrust upon them.
|
|
|
|
|
Well, as long as you are somewhere else, you can't be infected.
|
|
|
|
|
Would life on Europa consist of Europeans?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Yes, but on Io only Ions can survive.
Get me coffee and no one gets hurt!
|
|
|
|
|
Cornelius Henning wrote: Yes, but on Io only Ions can survive.
Wouldn't that be Ionians?
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
|
Only when they all visit the porcelain throne at the same time.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
While I wasn't using DbParameter.AddWithValue(..) but instead created them, set .DbType and .Value and then added them to the DbCommand, for strings, byte-arrays and numerics with precision/scale I wasn't initializing .Length, resp. .Precision and .Scale.
From this answer[^] by @jorgen_andersson I learned that I should do it: Knocked down a lengthy DB-insert from 139 to 86 seconds!
(If you're interested in the details the link Jörgen provided in his answer is worth a read.)
Thank you, Jörgen!
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Very interesting actually. I always use AddWithValue as well. Guess I should rethink that. It hasn't been a big problem, though, because I've never had any inserts of that magnitude.
Also interesting to know that you have a sock puppet account called "Foothill"...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Johnny J. wrote: Also interesting to know that you have a sock puppet account called "Foothill"... Learning stuff you didn't even think about asking for is one of the things I like best about CP
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Johnny J. wrote: Also interesting to know that you have a sock puppet account called "Foothill"...
Umm, that's a negative. Proper handling of SQL parameterization seems to be a popular subject.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
|
|
Repeat 100000 times, it adds up.
But yeah probably a bit underwhelming, You'll notice a difference the more complex the query is.
|
|
|
|
|
Remembered another reason for using Prepare .
It will complain on compilation if you have not defined sizes on all parameters.
|
|
|
|
|
Thank you, Jörgen! That will be useful indeed, even in my current project where I mostly have ad-hoc queries, but this way I can verify in development that all command-building parts initialize the sizes of parameters.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Nice one!
|
|
|
|
|
You did upvote it right before posting this, right?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Actually I didn't. I thought I had when I first saw it, but apparently not. So, now I have and thank you for the hint. However, I'm puzzled as to why you would ask?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Because I checked your link, contained one upvote. Read it, and upvoted it, and the count remained one.
I scan the forum in a similar way for the same reason, and the green posts always draw some attention.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I had a good laugh at this, my DAL began life in the 90s, way before AddWithValue was invented. I specify the length and precision of each parameter (code generator).
I recently had a "discussion" with a young whipper snapper who wanted to change the DAL, this information would have shortened the length of the "discussion" dramatically.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: this information would have shortened the length of the "discussion" dramatically. The figures are even better than in my original message: That's the total time the insertion code takes to finish which also includes building the SQL statements. As I ran the time comparison I was so excited how dramatically it dropped that I totally forgot about that before I wrote the message
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
In Case Robots Take the Jobs[^]
Takes Marx one step further, now you don't even need to have ability. Well, now I feel better.
Quote: From each according to his abilities, to each according to his needs. Karl Marx
|
|
|
|
|
If wages drop, by definition this makes demand for goods and services drop - so if we automate everything and wages drop to zero then demand for anything except life essentials will drop to zero and there will be no reason for the robots to make anything.
|
|
|
|