troubleshooting Question

Save a Date (dd/mm/yy)

Avatar of Eamon
EamonFlag for Ireland asked on
Visual Basic.NET
7 Comments1 Solution1059 ViewsLast Modified:
I have the following storedprocedure in a sql express database

ALTER PROCEDURE [dbo].[FillRunLog]
      -- Add the parameters for the stored procedure here
      @RunNo int = 0,
      @RunDate datetime
AS
BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;

    -- Insert statements for procedure here
      insert into RunLog(RunNo,Rundate)
      SELECT @RunNo,@RunDate)
END


i want to call this SP from code using a Command

Cmd.CommandText = "FillRunLog " & 5 & ", '" & Now & "'"
Cmd.ExecuteNonQuery()

this should fill 5 into RunNo and current date and time into RunDate

now has the valuse  #2/21/2006 12:50:43 PM#  which is the 21st of Feb. Which is correct.
I am pretty sure I am getting an error because it is trying to save this as the 2nd day of the 21st month which is american format.

How can get it to save the way I want.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros