|
This looks like a database question, not a C# issue.
And wildcard operations aren't the same for all databases, so you'll have to specify what it is you are using.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hi,
I am using Oracle10g database.
Thanks,
Umesh Tayade
|
|
|
|
|
|
Windcards? Where did the OP mention chronic flatulence?
|
|
|
|
|
Sorry. I meant windcharts of course. Fixed it. Thanks.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Seriously, you can't see the issue. Take a look at your file names and point out the name that starts with 'TEST_' . I see TestDocument and Test45 no Test_
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I know that there is no document with the name TEST in my database but what i am telling is that when i search for TEST_ it should not have to return any records. but it is returning the records.
Thanks,
Umesh Tayade
Never Underestimate the power of Human Stupidity
|
|
|
|
|
It is returning records because you have two sets of wildcards in the query. In other words, you have the % and the _ characters. Effectively, your query is %TEST%.
|
|
|
|
|
If you want to use the _ as a valid identifier in your query rather than having it act as a wildcard, you should precede it with a \ , so your query would become %TEST\_% .
|
|
|
|
|
Are you aware that, in Sql Server at least, the underscore character (_) is the wildcard for a single character? Very nasty in my opinion. You may wish to specify a different character in your query.
|
|
|
|
|
Hi
I have 50 splitcontainers.. i want to read all the splitcontainers & its panels programmatically...Is it possible...?
Because the below code only reads Splitcontainer4 & Panel1, But Iam looking to read all the splitcontainers and its panels programmatically...
foreach (Control Ctrl in this.splitContainer4.Panel1.Controls)
{
if (Ctrl is RichTextBox)
{
((RichTextBox)(Ctrl)).KeyPress += new KeyPressEventHandler(this.Common_KeyPress);
}
}
Thanks for ideas...
Regards
PARAMU
|
|
|
|
|
Just expand your code to add a foreach statement to check each SplitContainer in this , and each Panel in the SplitContainer s.
The best things in life are not things.
|
|
|
|
|
Can you show some samples..I tried...I didn't get...?
foreach (Control AllCtrl in this.Controls)
{
if (AllCtrl is SplitContainer)
{
foreach (Panel MyPanes in AllCtrl.Controls)
{
MessageBox.Show(MyPanes.Name, "some text", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
}
Thanks
|
|
|
|
|
Paramu1973 wrote: I didn't get
Didn't get what?
Try running this in your debugger to see exactly what containers you are picking up at each point. Apart from anything else it will help you to understand exactly what each step of your program is doing.
The best things in life are not things.
|
|
|
|
|
Hi Thanks.
But the problem is splitcontainer1.panel2 is having splitcontainer2
And splitcontainer2.panel1 is having splitcontainer3
and splitcontainer3.panel2 is having splitcontainer4
and splitcontainer4.panel2 is having richtextbox1
like wise no any order..they docked...and some panels are having label & some panels are having richtextbox...
I need to catch that control...
Thanks
|
|
|
|
|
Naming a variable "AllControls" won't get you "all controls". Instead, when you find a SplitPanel , call your method again, using the SplitPanel as the new source;
void Bla(Control SourceCtl)
{
foreach (Control Ctrl in SourceCtl)
{
if (Ctrl is RichTextBox)
{
((RichTextBox)(Ctrl)).KeyPress += new KeyPressEventHandler(this.Common_KeyPress);
}
else if (Ctrl is SplitPanel)
{
Bla(Ctrl);
}
}
}
The technique is called recursion. (Didn't test the method, but should be close enough to get you started)
Bastard Programmer from Hell
|
|
|
|
|
You're getting closer. Try this:
void DoAllRichTextBoxes(Control control) {
RichTextBox rtb=control as RichTextBox;
if (rtb==null) {
foreach(Control c in control.Controls) DoAllRichTextBoxes(c);
} else {
rtb.KeyPress+=new KeyPressEventHandler(this.Common_KeyPress);
}
}
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I got it. Thanks a lot.
Again Thanks Regards
PARAMU
|
|
|
|
|
you're welcome
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
If you've got 50 splitcontainers on a form, your bigger problem is that you have a user interface that is horrible. For the vast majority of apps, 2 splits on a single form would probably be the maximum you would ever use at once.
|
|
|
|
|
Loop all controls on your form and match all splitContainers, for each splitContainer loop controls to find your RichTextBox.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Controls can be nested in a hierarchy. A SplitContainer typically contains two Panels, inside these Panels you could have RichTextBoxes directly, but also other Containers (Panels, GroupBoxes, SplitContainers, ...) which again contain whatever you like.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
whats the need of this much spit containers ?
|
|
|
|
|
Hello,
I have question in my mind since long time. While using exception handling, we guess which exception would come and use catch block like, catch(FileNotFoundException) or DivdeByZero etc.
Instead of this why should I not always us base class 'Exception' and let .Net Framework decide which exception has occurred? And using StackTrace property we can easily know type of exception.
Regards
|
|
|
|
|
You are free to do it any way you like in your code. However, the reason for catching specific exceptions is that you may be able to take some action that will recover from the error. For example, if you catch FileNotFoundException then you can always offer the user the opportunity to manually select a different file etc. If you just print out the stack trace and terminate you may have wasted some minutes or hours of the user's working day.
The best things in life are not things.
|
|
|
|