|
You need a ";--" at the end because of the order by, but yeah, its pretty bad.
|
|
|
|
|
eggsovereasy wrote: You need a ";--" at the end because of the order by
Not really, the "order by" was taken care of by the preceding "select * ", although it is unnecessary since no row will be returned.
|
|
|
|
|
|
Long time ago, in a vb6 application I found this:
Private Sub SetFocusControl(ByRef objControl As Control)
Dim EnabledControl As Boolean
EnabledControl = objControl.Enabled
objControl.Enabled = True
objControl.SetFocus
objControl.Enabled = EnabledControl
End Sub
Marc R.
|
|
|
|
|
That person must have come from the Access world where you can't set the focus to a control unless it's Enabled first. IIRC, you couldn't even set the Text of a control unless it had the focus!
|
|
|
|
|
Not at all! He is from c and c++ world...
Marc R.
|
|
|
|
|
MarcR. wrote: He is from c and c++ world...
I guess VB6 can do that to the best of us.
BDF
|
|
|
|
|
Typical VB code script.
Follow your nose using DoubleAnimationUsingPath
|
|
|
|
|
Hi,
I think control must be enabled then only we can set the focus.Because i faced this problem in one of my project.
If the control is in diabled then we can't do any operation on it.if you want set focus on the control, it must be enabled as per the code which you written here.
otherwise it throws the exception....
Any mistake pls forgive me.
Thanks and Regards
Ganesan.S
Software Engineer
|
|
|
|
|
The question is, why would you want to imperatively set focus on a potentially disabled control?
It's like, are you giving a user a listbox that lists all of the controls on the form and when they select one, you set focus to it? I mean I could see how that's useful...like if you have 20 thousand controls on the form. But here's the real question...Why would you want to make a disabled control enabled?
Maybe it was a handler for a checkbox and when the user checks the box, it enables a previously disabled control and sets the focus so the user...can...oh wait, it disables the control before the user can do anything.
WTF?
|
|
|
|
|
bool bool_report_progress = false;
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
...
if (bool_report_progress)
backgroundWorker1.ReportProgress(x, listbox1_Search.Items.Count + " items were found so far.");
}
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
lable_reported_progress.Text = e.UserState.ToString();
}
private void checkbox1_report_progress_CheckedChanged(object sender, EventArgs e)
{
<font color=#00ee00>bool_report_progress = lbl_reported_progress.Visible = checkbox1_report_progress.Checked;</font>
}
As if I've been charged per letter;P
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
...do it all in Page_Load!
My company recently purchased a smaller company and our development department took over developing their web applications. My first task was to put a new user control on a few pages in one of the apps. While working on the first page I noticed something a bit odd...
(Sorry for the VB. In my defense, I didn't write the app.)
Private Sub Page_Load(blah, blah) Handles Page.OnLoad
' create some objects, initialize some variables
If Page.IsPostBack
' validate the user input
ValidateInput()
' save the user input to the database
SaveInput()
End If
End Sub
Farther down in the code I find this...
Private Sub Submit_Click(obj, args) Handles btnSubmit.OnClick
' direct the user to the new page
Response.Redirect(page.aspx)
End Sub
Smile and the world smiles with you. Laugh and the world thinks your insane.
|
|
|
|
|
I feel your pain there. I'm working on a website right now, and the framework we are using to build it - all its samples, all the pages that are there to build upon - not a single event handler. All postbacks and redirects. Sometimes it makes me want to puke
|
|
|
|
|
And this guy still lives?!!!!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
|
|
|
|
|
disable reader(1)
return
gosub printMainMenu
' disable reader(1)
return
I found this little pretty in a basic program im writing. the indentation indicates my genius.
|
|
|
|
|
bigbrownbeaver wrote: the indentation indicates my genius
The lack thereof indicates otherwise.
|
|
|
|
|
Apparently it was stripped out when I posted it. Double wammy
|
|
|
|
|
tip 1!
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
This one showed up in a code review. 'Nuff said.
string EntityID = new System.Text.StringBuilder("").ToString();
Cheers!
Humble Programmer
,,,^..^,,,
|
|
|
|
|
That is the better substitute for string.Empty
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
Hey - you told that intern to use StringBuilder , because it is presumed to be faster.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
C# is a mighty tool
Greetings from Germany
|
|
|
|
|
would of been funnier like this
string EntityID += new System.Text.StringBuilder("").ToString();
|
|
|
|
|
Humble Programmer wrote: string EntityID = new System.Text.StringBuilder("").ToString();
string EntityID = new System.Text.StringBuilder("").ToString()<blink>.Replace("", "");</blink>
This should make it faster;P
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
DEATH TO THE BLINK TAG!!!!!
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|