Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Form Query and GridView for ASP.NET 2.0

Reply
Thread Tools

Form Query and GridView for ASP.NET 2.0

 
 
dm1608
Guest
Posts: n/a
 
      02-18-2006
Hi all --

I'm rapidly learning ASP.NET 2.0 (never really did much .NET before...
mainly an ASP and PHP guy until now) and seem to be having some technical
challenges that I'm hoping someone can help me with.

I've created an n-tier application that consists of a Business Access Lay
and a Data Access Layer to query a SQL Server database. The classes are
stored within my App_Code directory.

The application is a rewrite of one of my earlier ASP applications where I
have a form that a user selects various checkboxes and dropdown lists and/or
types in a text string that will query a database and return all rows that
match that criteria.

One of the changes that I'm making is adding Peter Blum's DataTextBox
controls for a "Start" and "End" date prompt to be used to filter records by
date.

The issue that I'm having is that for some reason, when a user enters a date
such as "02/18/2005" and Peter's DateTextBox.Text property shows
"02/18/2005" and this is the property that I bound my ObjectDataSource to
for the GridView that I'm using. When the date gets passed to my BAL, it is
showing as "02/18/2005 12:00:00 AM". I've tried changing the data type of
the "StartDate" variable to be of type string instead of DateTime and I'm
still getting the same results.

This is causing me issues because if the user wants to query all rows for
today, the StartDate will be 02/18/2005 12:00:00 AM and the EndDate will
also be 02/18/2005 12:00:00 AM which causes no rows to be returned.

I want to somehow get rid of the time and add it to my DAL's SQL
statement... to use 12:00:00 AM for the start time and 23:59:59 for the end
time.

Has anyone else experienced these sort of issues before.

I have even tried changing all my references to StartDate and EndDate to be
of type string... Howver, when I try and do an Add() method to my generic
collection, an exception is thrown about not being able to convert a
DateTime type to a string type; even though I typed-casted the field to a
string.

Any help would this would be appreciated.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need some help with Ruby query building and query time Alpha Blue Ruby 3 07-28-2009 06:52 PM
How to retrieve form field value if form is EncType=multipart/form-dataForm? Li Zhang ASP .Net 4 02-27-2009 01:23 AM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
Form Query and GridView for ASP.NET 2.0 dm1608 ASP .Net 1 02-19-2006 08:29 PM
CGI - How to use upload_hook and query the query string ? roadrunner Perl Misc 1 02-08-2006 01:50 AM



Advertisments