Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
Happy New Year.

i have imported data from excel to Data set. it has date fields (Format:dd/MM/yyyy).

I am inserting Values in DB by converting Date Format to MM/dd/yyyy by using Globalization.

in Loop, First time date is converted from dd/MM/yyyy to MM/dd/yyyy .

but in next loop date field in data set it self in the format MM/dd/yyyy .

how can we resolve this?

Regards,
Pal
Posted
Updated 1-Jan-12 22:23pm
v2
Comments
Prasad_Kulkarni 2-Jan-12 4:23am    
can u post the code,??
amit28august 2-Jan-12 4:30am    
try to use Convert.ToDateTime('Ur_date_variable').ToString("dd-MMM-yyyy");
and then try to insert it.
sriman.ch 2-Jan-12 4:46am    
Post your code so that we can Help you...?
RaviRanjanKr 2-Jan-12 14:41pm    
without getting your effort its not easy for us to find out whats going wrong :)

First you check if your excel sheet datacolumn is in format of datetime? and also check the format of it.
May be it is MM/dd/yyyy
 
Share this answer
 
If you are sure that conversion requires only first time use some flag. By checking the flag status you can perform conversion operation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900