|
When I have to search by dates with times I do a 'from date' and a 'to date' because of the time issues. The from date should be the date with a time of midnight and end date would have a time of 1 second before midnight.
For example, if I wanted everything from April 1 through April 7 I would search for:
2009/04/01 00:00:00 through 2009/04/07 23:59:59
|
|
|
|
|
look at your table data and see what format it is and try something like this
string str_Verlaufdate = "'" + p.Verlauf_date.ToString("mm/dd/yyyy HH:mm:ss") + "'";
or some other format
do some research here[^]
|
|
|
|
|
thanks a lot,
this link solved my problem
|
|
|
|
|
Now, forget everything you just learned and do it the correct way using parameterized queries[^] instead. If you did that first, this would never have been a problem.
|
|
|
|
|
Hear hear!
There's no substitute for doing it the right way.
|
|
|
|
|
Good morning.
I am trying to create a verification class to test for special characters (not including *) when a user types in a text box. I will be running this off of the textbox keydown (or change) method.
So far I have the following:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WindowsFormsApplication1
{
class Verification
{
public bool Verify(String strChar)
{
bool InvalidChar = false;
int NumValue = 0;
char[] charArray = strChar.ToCharArray();
foreach (char c in charArray)
{
NumValue += (Convert.ToInt16(c) + 128);
if (NumValue == 42) //ASCII * character
{
InvalidChar = true;
break;
}
else if (NumValue < 65 && NumValue > 90) //ASCII A-Z characters
{
InvalidChar = true;
break;
}
}
return InvalidChar;
}
}
}
I was advised to stay away from Substrings. What is the best method to accomplish this verficiation?
Thank you,
WHEELS
|
|
|
|
|
Regex, or if you want to loop through all of the chars in the string the Char[^] class has a bunch of functions like IsLetter , IsDigit , etc that should help you.
|
|
|
|
|
|
|
hi there!
I want to know if is possible to print the dataTable or a data from datagridview, I was searching 2 -3 days for this thing, but without any success. Every help will be appreciated. thanks in advance, Laziale
|
|
|
|
|
As far as i know, as with all printing you need to do all the work yourself. there is certainly no built in function to print a data table. I assume you must have come across alot to do with printing so start there, but as i say you will have to draw all the info you want to a graphics class instance which is what you will be printing
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
You can search for DataGridView Printer (I used one before) here on CP, if that's your question
|
|
|
|
|
I have a test
if (element.Value.ToString().ToLower() == "home owner")<br />
{<br />
summaryHomeOwnerTextBox.Text = "Yes";<br />
}
How can I test to see with the string "home owner" is contained within element.Value.ToString().ToLower() please?
|
|
|
|
|
too lazy to read up on String class?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
or even use the Intelisense of an IDE, there all pretty self explainitory methods and functions lol
but hey, as im sure you know already, there are alot of people on these forums that just are'nt cut out for this kind of 'hard' work
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
kanchoette wrote: if (element.Value.ToString().ToLower() == "home owner")
if (element.Value.ToString().ToLower().Contains ( "home owner") )
|
|
|
|
|
Hi,
I need to use the System.Printing.Activation dll bu I'm unabled to find it in the .NET Framework 3.5 in my VS 2008 environnement
I was searching on the net but I can't find it and I saw no other case like mine. Did somebody have tehe same problem I have.
Please help me.
Regards.
|
|
|
|
|
I just found an answer. This dll is include into the ReachFramework.dll
thanks.
|
|
|
|
|
This namespace is found in these assemblies:
System.Printing.dll
|
|
|
|
|
not exactly, i needed to add a reference to the ReachFramework.dll because the System.Printing.dll doesn't contain it
|
|
|
|
|
Perhaps it was once in System.Printing.dll before, This[^] was one of 2 hits from google for "System.Printing.Activation" (with quotes), but I guess you're right, good find!
|
|
|
|
|
Ahh A little more searching took me to here,[^] which shows the dll you spoke of also listed as containing that namespace.
Good job
|
|
|
|
|
Thank you for your interest and your involvement.
|
|
|
|
|
Hi.
I wanna know , Can we change amount of a const variable at run time for ever.
I mean , when we change the amount, it will be firm even after closing and running the Application again.
Thanks
|
|
|
|
|
You can use readonly instead of const and you can save that value in an XML file, txt, database etc.
Hope this helps
|
|
|
|