how to insert date of birth from asp.net page to sql server 2008
i m using
str="insert into date values('"+TextBox1.Tex)+ "')";
ad=new SqlDataAdapter (str,CT.connect());
dt = new DataTable();
ad.Fill(dt);
query in .cs page but it gives error msg..

Jignesh TrivediPosted Jul 20, 2012, 12:03 AM
try
DateTime mydate;
bool success = DateTime.TryParseExact(TextBox1.Text, "dd/MM/yyyy", new CultureInfo("en-US"), DateTimeStyles.None, out mydate);
Console.Write(mydate);
mydate use with your insert query and also pass your data format
Also I think ad.Fill used for fill the data set in this case you must use command.
hope this will help you.