|
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.
|
|
|
|
|
Just to clarify... did David Bowie have a glittering career?
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Well, they say that intelligence sign is a words over stumbling.
.
|
|
|
|
|
Just another way of saying, "WTF am I doing?"
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
I know, lets keep re-comparing strings as it's cheap and easy. Thank you VB6; the gift that keeps on giving.
Public Function sConvertCase(sInString, lType As VbStrConv) As String
Dim sReturn As String
Dim lPos As Long
Dim lStart As Long
Dim lNext As Long
On Local Error Resume Next
sReturn = StrConv(sInString, lType)
If lType = vbProperCase Then
lPos = 0
Do
lStart = lPos + 1
lPos = InStr(lStart, sReturn, "Mc")
lNext = InStr(lStart, sReturn, "Mac")
If lNext > 0 And (lNext < lPos Or lPos = 0) Then
lPos = lNext
End If
lNext = InStr(lStart, sReturn, "O'")
If lNext > 0 And (lNext < lPos Or lPos = 0) Then
lPos = lNext
End If
lNext = InStr(lStart, sReturn, "Von ")
If lNext > 0 And (lNext < lPos Or lPos = 0) Then
lPos = lNext
End If
lNext = InStr(lStart, sReturn, "-")
If lNext > 0 And lNext < lPos Or lPos = 0 Then
lPos = lNext
End If
If lPos = 0 Then
ElseIf Mid$(sReturn, lPos, 1) = "-" Then
Mid$(sReturn, lPos + 1, 1) = UCase$(Mid$(sReturn, lPos + 1, 1))
ElseIf Mid$(sReturn, lPos, 2) = "Mc" Then
Mid$(sReturn, lPos + 2, 1) = UCase$(Mid$(sReturn, lPos + 2, 1))
ElseIf Mid$(sReturn, lPos, 3) = "Mac" Then
If Mid$(sInString, lPos, 3) = "Mac" And Mid$(sInString, lPos + 3, 1) = UCase$(Mid$(sInString, lPos, 3)) Then
Mid$(sReturn, lPos + 3, 1) = UCase$(Mid$(sReturn, lPos + 3, 1))
End If
ElseIf Mid$(sReturn, lPos, 2) = "O'" Then
Mid$(sReturn, lPos + 2, 1) = UCase$(Mid$(sReturn, lPos + 2, 2))
ElseIf Mid$(sReturn, lPos, 4) = "Von " Then
Mid$(sReturn, lPos, 1) = "v"
End If
Loop While lPos > 0
End If
Done:
sConvertCase = sReturn
End Function
|
|
|
|
|
I can't see how it's connected to VB6 (or any language for that matter)...It's a pure human problem...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|