473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

convert string to date

How can to save a string("13/12/2007") in a field which datatype is date in
the table?

field["dob"] = xxx?

Dec 13 '07 #1
3 2921
"Elliot" <el************@hotmail.co.ukwrote in message
news:BA**********************************@microsof t.com...
How can to save a string("13/12/2007") in a field which datatype is date
in the table?

field["dob"] = xxx?
field["dob"] = Convert.ToDateTime("13/12/2007");
field["dob"] = DateTime.Parse("13/12/2007");
field["dob"] = ParseExact("13/12/2007", "dd/MM/yyyy", null);
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 13 '07 #2
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uF**************@TK2MSFTNGP02.phx.gbl...
field["dob"] = ParseExact("13/12/2007", "dd/MM/yyyy", null);
Apologies - slip of the Enter key...

field["dob"] = DateTime.ParseExact("13/12/2007", "dd/MM/yyyy", null);
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 13 '07 #3
Useful!
Thanks again.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eu*************@TK2MSFTNGP06.phx.gbl...
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uF**************@TK2MSFTNGP02.phx.gbl...
>field["dob"] = ParseExact("13/12/2007", "dd/MM/yyyy", null);

Apologies - slip of the Enter key...

field["dob"] = DateTime.ParseExact("13/12/2007", "dd/MM/yyyy", null);
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Dec 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
2
by: Abhishek Srivastava | last post by:
Hello All, I wrote the following program. using System; using System.Globalization; public class ShortDateTest { public static void Main(string args)
1
by: ABC | last post by:
How to convert a date string to datetime value with custom date format? e.g. Date String Date Format Result (DateTime value) "05/07/2004" "MM/dd/yyyy" May 7, 2004 "01062005" ...
1
by: Sam | last post by:
How do I convert Julian Date to Calendar Date in ASP.Net 1.1 based on following guideline found at Internet? To convert Julian date to Gregorian date: double JD = 2299160.5; double Z =...
5
by: XML newbie: Urgent pls help! | last post by:
function to convert string to 1 dimensional array of long in VB.Net
2
by: Kakishev | last post by:
I have a problem at how best to convert a Date into a text field and keep the format dd/mmm/yyyy (01-FEB-2007). The problem is that dates are imported from SQL into an access front end Database....
19
by: robtyketto | last post by:
Greetings, I have the following code below which allows the date to be added via a JDBC connection as a STRING. The value of dateString is inserted into the MS ACCESS database. What is the...
5
satiss7pwr
by: satiss7pwr | last post by:
I have a string date like this: "3/28/2008 12:05:45 pm" i want to convert it into date and display the out put any one can help me plssssssssss
3
by: tanishka singh | last post by:
How do you convert string from database into date in asp.net? Dim output = (From tlb In obj.SelectRecordAll_SalesInquiryRegister _ Join tlb1 In LatestPOs On tlb.SIR_OfferNo...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.