Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to add currentdate to slqdatasource parameter

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
Im new to asp.net and trying to do some simple pages with the gridview control.

I can easily create a page that pulls records from a table if I enter in the "target" date as in:
<SelectParameters>
<asp:parameter DefaultValue="01/01/2011"


but I have been working for a couple of days now trying to figure out how to replace the "hard coded" 01/01/2011 with the current date whenever the report is run.

How can i replace DefaultValue with the current date at runtime?

any information would really be appreciated
 
don't use the datasource controls. use the ado.net objects in the codebehind. you have full control this way.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
ill try to figure that way out. I havnt done anything with this other than working with the datasource controls yet. So i dont know really where to start there yet.
 
the core building blocks of database access is ado.net. on top of ado.net you have a variety of libraries and methodologies to access the data.

the simplest form being raw ado.net objects. from there you have datasets and datatables. there are also ORM libraries built on top of ado.net.

the datasource controls and the composite controls like gridview & formview are more trouble than they are worth. problem is they are very appealing to new asp.net devs because of there "magic".

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
it did look like a quick way to get started, until i tried to do a "real" functional page that did more than a simple populate a grid based on a selection from a dropdown or something...

guess ill back up a few paces and start over... :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top