|
I think you will find you can get to some of them through the various Microsoft.VisualBasic namespaces.
|
|
|
|
|
I have three dates 1*,2*,3* ......
1* dateto = {4/9/2008 1:20:25 PM}// date time formate
range is like this
2* strdate=14-Feb-08 // string formate from datetime picker
3* enddate =14-Apr-08 // string formate from datetime picker
so now i have to check whether 1* lies between 2* and 3* or not..
can anybody suggest me what are the best ways to do...
i was trying to split the string and then compare first year then month then days
but that is going lengthy
so please help me here..
thanks in advance...
vikas da
|
|
|
|
|
The datetime picker returns a DateTime object, I thought. Just use the > operator to work out if your date is > the first and < the second.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello everyone,
To implement a service, I think we just need to derived from ServiceBase class, and implement some event handler function, like OnStart, OnStop, etc.
As described in the sample,
http://msdn2.microsoft.com/en-us/library/system.serviceprocess.servicebase(VS.80).aspx
What is the function of method InitializeComponent? I found it never called explicitly in the class SimpleService, nor there are any document from MSDN about this method. Any ideas?
thanks in advance,
George
|
|
|
|
|
George_George wrote: InitializeComponent
This is always where auto generated code lives, you should not modify it if you can help it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do we need to modify code for this method? Which party will invoke this method?
regards,
George
|
|
|
|
|
As Christian said, you don't need to modify it. Its just the designer code, so for example, if you drop a textBox on a form, all it's initialisations will go there such as it's size, location, name etc...
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Thanks Phannon,
Your reply is great! I think you mean this method will be maintained by designer (for example, if we add new Timer control, designer will add initialization code for Timer control in this method).
If we want any initialization code, we should put in constructor, right?
regards,
George
|
|
|
|
|
George_George wrote: Which party will invoke this method?
As CG said, it is auto generated. In windows application, controls will be initialized and added to the container in this method. This will be called from the constructor. In service you don't need this since you are not using any components like Timer etc. If you are using components like Timer, you can make use of this method to initialize the component and add it to the components collection which is IContainer instance. This helps the application to dispose the components used when service is getting disposed.
Hope this helps
|
|
|
|
|
|
George_George wrote: Do you think my understanding here is correct?
Yes.
George_George wrote: If we want any initialization code, we should put in constructor, right?
You can put the initialization code anywhere before the instance is used.
|
|
|
|
|
Cool, N a v a n e e t h!
Question answered.
regards,
George
|
|
|
|
|
hi,
for send Tab key >>> SendKeys.Send("\t");
but i want to know, how may I send BACK TAB which we usually use in form's textbox like "SHIFT+TAB"
SendKeys.Send(?????)
Thank you in advance
|
|
|
|
|
I guess for shift + tab its
Sendkeys.send("+{TAB}")
For Alt + tab its
Sendkeys.send("%{TAB}")
My idea of ideal life : Eat, Sleep, Repeat
|
|
|
|
|
Hi Guys. Hope you all had a great weekend.
I want to impliment some further validation on a textbox in one of my applications. I currently only check that the .TextLength is 11 characters and if not to throw an error message. Now, I wan to take it one step further by checking that first character is a specific character say, A or B and if not to throw an error.
i.e I want to check that the first character in A0812345678 is an A or B. If not then then throw error.
Can somebody please help with this?
Below the check to see if it is 11characters long:
if (txtboxHolderRef.TextLength < 11 || txtboxHolderRef.TextLength > 11)
{
MessageBox.Show("HolderID should be 11 characters" , "Invalid Field Length",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
|
|
|
|
|
Urm... how about myString.StartsWith("some string"); ??
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Why would you throw an error ?
|| (txtBoxHolderRef[0] != 'A' && txtBoxHolderRef[0] != 'B')
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Why would you throw an error ?
Hi Christian. Because If they don't capture the data correctly I want to error rather than let them capture incorrect data. I need to process this data into the main system at a leter stage and getting the data correct when they capture it reduces any manual fixing later.
I will give your suggestion a go and see what happenes.
Thanks for the advice again.
|
|
|
|
|
I meant I'd show the user a message, not throw an error
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
^[abAB]{1}.*$ This expression matches with all the words starting with a and b. Use this pattern with Regex class and check for a match. If no match found, throw an error. Also you may check this[^] article which explain writing rules to your business objects and binding the error provider to the control. It can make life more easy.
|
|
|
|
|
if (!txtboxHolderRef.Text.Lenght.Equals(11))
{
throw your error and return
}
else
{
String StartLetter = txtboxHolderRef.Text.Substring(1,1)
switch (StartLetter)
{
case "A": do something; break;
case "B": do some other thing; break;
default: break;
}
}
|
|
|
|
|
Hello,
I am coping contents of DataReader in to ArrayList and bind this ArrayList to dropdownlist1.Now i want to remove the item from my arraylist which has been selected by dropdownlist1,after deleting d item i want to bind the updated arraylist to the another dropdownlist and so on. My code looks like following....
item = new ArrayList();
conn.Open();
string qitem = " SELECT DESCRIPION FROM ITEM_MASTER ORDER BY DESCRIPION";
OracleCommand ocmd = new OracleCommand(qitem, conn);
OracleDataReader odr = ocmd.ExecuteReader();
if (odr.HasRows)
{
while (odr.Read())
{
item.Add(odr.GetString(0));
}
}
odr.Close();
conn.Close();
bind_control(ddl_mainItem, item);
Now i want to delete item selected by ddl_mainItem.What can I do?
Plz help me.....
|
|
|
|
|
Why are you still using .NET 1.1, and if you're not, why are you using arraylist ?
The List class certainly has an items collection which has a remove method, I believe ArrayList does, too.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
i'm Merging To DataTables Into 1
They are in same format , so far so good it's Doing it well
But When i'm trying to Update To The DataBase Nothing is Actually Done
No Saving of the Data.
This Is The Code :
<br />
dS_M_ICD.Interface_Details.Merge(dS_E_ICD.Interface_Details, true);<br />
<br />
M_Interface_D.Update(dS_M_ICD.Interface_Details);<br />
dS_M_ICD.Interface_Details.AcceptChanges();<br />
<br />
Have Fun
Never forget it
|
|
|
|
|
i want to apply the encription and decription on my data files by using c#. how can i do this in c#
|
|
|
|