Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
suni_dotnet8-Jan-09 6:29
suni_dotnet8-Jan-09 6:29 
AnswerRe: Error converting data type nvarchar to datetime, any suggestion Pin
Jon Rista8-Jan-09 6:15
Jon Rista8-Jan-09 6:15 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
Not Active8-Jan-09 6:31
mentorNot Active8-Jan-09 6:31 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
Jon Rista8-Jan-09 7:31
Jon Rista8-Jan-09 7:31 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
Not Active8-Jan-09 8:06
mentorNot Active8-Jan-09 8:06 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
Jon Rista8-Jan-09 8:16
Jon Rista8-Jan-09 8:16 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
suni_dotnet8-Jan-09 6:55
suni_dotnet8-Jan-09 6:55 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
Jon Rista8-Jan-09 7:34
Jon Rista8-Jan-09 7:34 
You need to change your stored proc, too. If your stored proc is like this:

CREATE PROCEDURE SomeProc
(
@filldate varchar(10),
@freedate varchar(10),
@name varchar(50)
)


Then you need to change that to:

CREATE PROCEDURE SomeProc
(
@filldate datetime,
@freedate datetime,
@name varchar(50)
)

And get rid of your conversion in the stored proc. You can't convert in both places...either convert in C#, or convert in the stored proc. If you convert in the stored proc, you will have to manually reformat the freedate and filldate strings to conform to the datetime format required by SQL Server to pass them in and convert them in the proc. Converting to DateTime in C# will be simpler, and a more stable implementation, than reformatting and converting in the proc.
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
suni_dotnet8-Jan-09 7:53
suni_dotnet8-Jan-09 7:53 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
Jon Rista8-Jan-09 8:06
Jon Rista8-Jan-09 8:06 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
suni_dotnet8-Jan-09 8:28
suni_dotnet8-Jan-09 8:28 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
Jon Rista8-Jan-09 9:12
Jon Rista8-Jan-09 9:12 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
suni_dotnet8-Jan-09 9:49
suni_dotnet8-Jan-09 9:49 
GeneralRe: Error converting data type nvarchar to datetime, any suggestion Pin
Jon Rista8-Jan-09 10:17
Jon Rista8-Jan-09 10:17 
QuestionEventhandle !!! Pin
RongNK8-Jan-09 4:36
RongNK8-Jan-09 4:36 
AnswerRe: Eventhandle !!! [modified] Pin
Wendelius8-Jan-09 4:41
mentorWendelius8-Jan-09 4:41 
GeneralRe: Eventhandle !!! Pin
RongNK8-Jan-09 5:05
RongNK8-Jan-09 5:05 
GeneralRe: Eventhandle !!! Pin
Wendelius8-Jan-09 5:33
mentorWendelius8-Jan-09 5:33 
AnswerRe: Eventhandle !!! Pin
Le centriste8-Jan-09 4:44
Le centriste8-Jan-09 4:44 
GeneralRe: Eventhandle !!! Pin
Luc Pattyn8-Jan-09 5:04
sitebuilderLuc Pattyn8-Jan-09 5:04 
QuestionShortcuts aint working when MultiLine is true Pin
Xmen Real 8-Jan-09 4:16
professional Xmen Real 8-Jan-09 4:16 
AnswerRe: Shortcuts aint working when MultiLine is true Pin
musefan8-Jan-09 4:24
musefan8-Jan-09 4:24 
GeneralRe: Shortcuts aint working when MultiLine is true Pin
Xmen Real 8-Jan-09 4:26
professional Xmen Real 8-Jan-09 4:26 
GeneralRe: Shortcuts aint working when MultiLine is true Pin
musefan8-Jan-09 4:33
musefan8-Jan-09 4:33 
GeneralRe: Shortcuts aint working when MultiLine is true Pin
Xmen Real 8-Jan-09 4:34
professional Xmen Real 8-Jan-09 4:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.