Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Date And Time Problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-06 : 08:38:54
ashraf writes "i a m tray to insert a date from user interface using asp.net(c#) in Db sql server 2000
but i have problem in insert stateme
i try and try
i think the error is related to the format returned form my asp.net
and the fromat that sql server accpt
cxan i mange tthe format osf sql srber db
please help me
this problem always make me use string for dates and time in declar column in db

utill i fopund ur site
if u please help meeeeee


thank for ur time"

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-06 : 09:11:19
well it would be nice if we could see some code.
that way we can gve some opinion...
with info you gave us we can only speculate.

use stored procedures with parameters for inserts.
for dates use datetime datatype.
the you simply add a parameter to an sproc:
dataAdapter.InsertCommand.Parameters.Add("@YourDateParameter", "14.2.2004");
or any other date you need.
if the input is not correct this will return an error.
for user input check you can use regular expressions.

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -