|
Unless it's purpose was to waste time and memory?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
|
|
Would have been better as an extension method.
Don't comment your code - it was hard to write, it should be hard to read!
|
|
|
|
|
using (SqlConnection Connection = Sql.GetConnectionString())
{
using (SqlCommand command = new SqlCommand("*****", Connection))
{
command.CommandType = CommandType.StoredProcedure;
try
{
Connection.Open();
intID = (int) command.ExecuteScalar();
}
catch (Exception ex)
{
command.Dispose();
Connection.Close();
Connection.Dispose();
}
finally
{
command.Dispose();
Connection.Close();
Connection.Dispose();
}
}
}
___ ___ ___
|__ |_| |\ | | |_| \ /
__| | | | \| |__| | | /
modified 2-Apr-14 9:06am.
|
|
|
|
|
Well, at least they're being sure the stuff is disposed of.
Too bad they also disposed of their ability to understand how Try/Catch works too.
|
|
|
|
|
Dave Kreskowiak wrote: disposed of their ability to understand how Try/Catch works and using also...
|
|
|
|
|
Pretty clear developer intent.
Yet it's also a scream for help.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Bloody beginners!
using (SqlConnection Connection = Sql.GetConnectionString())
{
using (SqlCommand command = new SqlCommand("*****", Connection))
{
command.CommandType = CommandType.StoredProcedure;
try
{
Connection.Open();
intID = (int) command.ExecuteScalar();
command.Dispose();
Connection.Close();
Connection.Dispose();
}
catch (Exception ex)
{
intID = 22;
command.Dispose();
Connection.Close();
Connection.Dispose();
}
finally
{
command.Dispose();
Connection.Close();
Connection.Dispose();
}
}
}
Also a great idea that Sql.GetConnectionString() does not return a string but a SqlConnection .
|
|
|
|
|
Maybe they came from Java and someone told them "you have to use using".
So they put a using in there...
|
|
|
|
|
|
So...did you buy anything from them?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I just wanted to know what a particular component does. I'm not looking to buy more.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
I would : they have obviously put all the workforce in the product, not in the marketing/website.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
Or...they put even less effort into the security than they did the marketing...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I saw this in a recent programming forum. It's probably time for him to call it a day...
"...one thing that confuses me with programming is putting lines in the correct order."
|
|
|
|
|
|
You mean you can't just write them in reandom order and expect it to work?? Maybe that's been my problem all these years!
|
|
|
|
|
Of course it won't work!
You "just write them in reandom order" and ask in QA to get it fixed
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
|
Interesting, Grieg's Piano Concerto is my favorite, just so sad to see such a beautiful piece treated so badly.
Dave.
|
|
|
|
|
Quote: one thing that confuses me with programming is putting lines in the correct order Before OOP most compilers were just top down in the order the lines appeared. Now with OOP line order isn't as important (calling order of course is) so perhaps that is where the confusion is. Still, hard to believe.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Not a problem with BASIC.
Of course, proper modern languages don't use lines at all. Which can make things easier, or not.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Really bad. As it was a post to a C64 forum, and it is about programming in BASIC, the answer should actualy be simple: ascending by line number.
|
|
|
|
|
Use a declarative style and it doesn't matter so much, as long as the values you need in a line are defined on values higher up.
|
|
|
|