|
please use <pre> and </pre> around your code to make it legible.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Well, what is the value of txtTelephoneNo.Text? If the value of a parameter is null, then it effectively doesn't get added. That said, I doubt the Text property of a textbox can ever be null, and I believe an empty string would be treated differently.
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: If the value of a parameter is null, then it effectively doesn't get added.
I don't think that's true.
|
|
|
|
|
I think so, unless I'm getting mad. SqlParameter has a value property, and if you want a sql null you set this to DBNull.Value, or the actual value if there is one. If null, then its like the parameter was never added.
It works well if you write a stored proc and default the value to null in Sql. You can just set the sql parameter to null in code, it doesn't get passed, and defaults to null Sql side.
Regards,
Rob Philpott.
|
|
|
|
|
It should either add the parameter or throw an Exception, not fail quietly.
I may want to set (change) the value later, and perhaps execute the statement multiple times.
|
|
|
|
|
Not at all. It's a simple means where you do not have to worry about null/DBNull conversion in code.
Regards,
Rob Philpott.
|
|
|
|
|
Hi Guys. I have written a Windows Service with a FileWatcher. Now, when there are new files in the directory it picks the files up fine but when it has to copy then out into a new directory I get an error of The given path's format is not supported . Below is the copy function.
try
{
string path = fsw.Path;
string outPath = "C:\\TestDir2\\";
char[] trimchars = new char[] { '.', 't', 'x', 't' };
DirectoryInfo dinfo = new DirectoryInfo(path);
foreach (FileInfo finfo in dinfo.GetFiles("*.*"))
{
File.Copy(finfo.FullName, outPath + finfo.FullName, true);
}
}
It stops on the line: FIle.Copy(finfo.FullName, outPath + finfo.FullName, true); . Anybody have any ideas?
Excellence is doing ordinary things extraordinarily well.
modified on Friday, June 12, 2009 8:26 AM
|
|
|
|
|
Did you debug to see what is the value in the variables and are they similar to what is expected as Copy params?
By the way what is the error? do you get an exception. If yes, which one?
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Yes, I have debugged it and low and behold, I missed it, should not have used outPath + finfo.FullName , should have used outPath + finfo.Name .
Silly mistake.
Thanks anyway.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Help others by editing your original post add [solved] to the title and at the end anotate the solution.
There are those of flamable nature who might jump at a silly mistake, we all make them, so pre-empt them by telling them.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Happiness?? Never seen anybody else do that!!
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Thanks. Your original was, as I said, a bit of a silly mistake and in that scenario it is better to tell others that you have realised what you did wrong.
If everyone would mark the thread headers with the solutions the forums would be easier to follow.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I did that in my reply. I mentioned exactly what I did wrong and rectified it.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Hi,
I have the following code
StreamReader sr = new StreamReader(strMainPath);
string allRead = sr.ReadToEnd();
sr.Close();
regMatch = textBox1.Text;
if (Regex.IsMatch(allRead, regMatch))
{
richTextBox1.Find(regMatch);
richTextBox1.SelectionColor = Color.Red;
richTextBox1.SelectionBackColor = Color.Yellow;
}
from textBoxi.text i am getting the word to search.
It is searching and getting the result, if that word is there
it highlighed.But my problem is to focus on that text in text area.
If the file is very large ,i have to scroll to findout where is the highlighted text.Instead of that i want to focus on that text.
Is there any way?
Pls help
|
|
|
|
|
Hi,
have a look at ScrollToCaret().
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Damned you Luc!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Chill out you bloody Hungarian.
Did it really take you three minutes to type those two sentences?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Yes it bloody did!
I had to do lots of copy/paste scroll test stuff. I don't just make these answer up off the cuff you know. Research is the answer. And Gin. Never underestimate Gin.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Nagy Vilmos wrote: I don't just make these answer up off the cuff
I believe you. Well. Most of the time I do.
Nagy Vilmos wrote: Research is the answer.
Sure it is. I did appreciate your latest research report[^].
FWIW: I tend to perform my research in advance, those three minutes may prove to be very critical.
Nagy Vilmos wrote: Never underestimate Gin.
Gin is fuel, it is essential, couldn't do without; it is not an excuse for a slow down.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
use the ScrollToCaret() method to scroll to the current cursor position.
BTW Is the file content in allRead copied into richTextBox1 ? You do know that you can load a file directly into the control?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hi all,
When i open my windows ce application in device the wifi is disconnected automatically.
before opening the app(in constructor) the application is actually retriving the data from the xml file(web call) storing it into hashtable object.i did not get why wifi is disconnecting in the device.
Do anybody have idea what is the wrong?
Thanks.
|
|
|
|
|
Hi,
You should post this in the Mobile Development section.
You need to contact your device manufacturer to obtain an SDK or utility for that device.
Regards
Mick Curley
|
|
|
|
|
Hi,
How to print a document directly without showing print dialouge.
Eg. When i click a button, a document in a given path should print directly without showing print dialouge .
Thankyou
YPKI
|
|
|
|
|
Generally, that should be possibile. How, this depends by the document type.
What type of document you are trying to print?
|
|
|
|
|
for example: bill or any thing in a small piece of paper
|
|
|
|