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 / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

Retrieving Data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barry - 14 Nov 2006 10:21 GMT
Hi

I have some 10 records in a table with a DateTime field, all the records
have the same data but the time of each records is different.

Using a stored procedure how do i retrieve all records

eg AppendParameter(cmd, "@CallDate", DbType.DateTime, dt);

TIA
Barry
Ciaran O''Donnell - 14 Nov 2006 10:45 GMT
You need to search from an to.  For you where clause, do
Where thedatefield >= @from and thedatefield < @to

and parse in from c#

AppendParameter(cmd, "@from", DbType.DateTime, dt.Date);
AppendParameter(cmd, "@to", DbType.DateTime, dt.Date.AddDays(1));

Or you could do the date conversion in the stored proc. There are various
ways to do this. Some I have seen are making @from by converting the calldate
passed in to a varchar with no time in it, and making @to with the same
varchar + '23:59:59'.
Or converting to an int and back for @from and then DATEADD'ing a day to get
@to.

Its up to you

Ciaran O'Donnell

> Hi
>
[quoted text clipped - 7 lines]
> TIA
> Barry

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



©2008 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.