Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

GridView date string to SP to table DateTime col

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John A Grandy - 15 Feb 2006 08:14 GMT
VS05 : GridView control config'd to use SPs in SS05

One of the SPs takes a vchar(50) which in the T-SQL needs to be converted to
a DateTime.

How should I have the GridView format the text the user enters in the date
col ?

Currently, if user enters "2/14/2006" , I format it as '2/14/2006'  ... but
this gives me a runtime error:

Server Error in '/code' Application.
----------------------------------------------------------
The string was not recognized as a valid DateTime. There is a unknown
word starting at index 0.

My table has a primary key defined on an Identity col.
DWS - 15 Feb 2006 13:55 GMT
Maybe use date.parse

> VS05 : GridView control config'd to use SPs in SS05
>
[quoted text clipped - 13 lines]
>
> My table has a primary key defined on an Identity col.
John A Grandy - 15 Feb 2006 17:08 GMT
I think the problem is trying to send it down to SS05 as a DateTime.  Better
to send it as a String.

Unless, I've misunderstood SQLDataSource, I believe that you specify .NET
datatypes for your SP params, not SS datatypes.

In other words, write the SP to accept a varchar param, not a datetime param
..... in the SP, use format 'yyyymmdd' and CAST(@datetime1 AS datetime) will
work ..........

Honestly, I'm not sure the VS05 GridView is such a great invention ....
despite all the hype.

> Maybe use date.parse
>
[quoted text clipped - 18 lines]
>>
>> My table has a primary key defined on an Identity col.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.