Hi all,
I am facing a problem. I create a application that is insert date and time in SQL Server 2005 table from web page then i fetch this datetime type field in vb.net application and adding some hours or minute into it then again update that field
but the problem is when i insert via web (my .aspx page) it save as different format then the other one same function i use in vb.net application will give me different format in sql server
i use these-
.net version 2.0
my system windows XP regional setting has date format as dd/MMM/yyyy time format as h:mm:ss tt
sqlserver 2005 table with datetime field
in my aspx pages i use-
<font style="color:#0 09900">dim newdt1 as datetime<br>
newdt1 = Microsoft.Visua lBasic.FormatDa teTime(newdt, DateFormat.Gene ralDate)</font>
This is inserting date in sql server - 17.11.2008 15:23:54
after that i select this date in vb.net application project
<font style="color:#0 09900">dim newdttime as datetime<br>
' adding hr and min into current time<br>
newdttime = Date.Now.Add(Ne w TimeSpan(0, 10, 0))<br>
newdttime = Microsoft.Visua lBasic.FormatDa teTime(newdttim e, DateFormat.Gene ralDate)</font><br>
sql server save it as 17/Nov/2008 03:33:26 PM
<b style="color:#9 90000">My question is that same function is giving me different date format.</b> Why?
I am facing a problem. I create a application that is insert date and time in SQL Server 2005 table from web page then i fetch this datetime type field in vb.net application and adding some hours or minute into it then again update that field
but the problem is when i insert via web (my .aspx page) it save as different format then the other one same function i use in vb.net application will give me different format in sql server
i use these-
.net version 2.0
my system windows XP regional setting has date format as dd/MMM/yyyy time format as h:mm:ss tt
sqlserver 2005 table with datetime field
in my aspx pages i use-
<font style="color:#0 09900">dim newdt1 as datetime<br>
newdt1 = Microsoft.Visua lBasic.FormatDa teTime(newdt, DateFormat.Gene ralDate)</font>
This is inserting date in sql server - 17.11.2008 15:23:54
after that i select this date in vb.net application project
<font style="color:#0 09900">dim newdttime as datetime<br>
' adding hr and min into current time<br>
newdttime = Date.Now.Add(Ne w TimeSpan(0, 10, 0))<br>
newdttime = Microsoft.Visua lBasic.FormatDa teTime(newdttim e, DateFormat.Gene ralDate)</font><br>
sql server save it as 17/Nov/2008 03:33:26 PM
<b style="color:#9 90000">My question is that same function is giving me different date format.</b> Why?
Comment