If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > gridview queries help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-13-08, 20:51
aa_86 aa_86 is offline
Registered User
 
Join Date: Feb 2008
Posts: 49
gridview queries help

Hi,

i am trying to make a query using gridview in visual studio 2005. i can use grid view to display tables and queries, but it wont display parameter value queries created in access.

i have a reservation table, i want to enter date from and date to feilds and the return should be a reservation between those dates. any ideas?

thanks
Reply With Quote
  #2 (permalink)  
Old 04-14-08, 08:31
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
You can't use Access parameter queries; you have to make your own in the FE.
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 04-14-08, 19:22
aa_86 aa_86 is offline
Registered User
 
Join Date: Feb 2008
Posts: 49
can i use the source code access gives?
Reply With Quote
  #4 (permalink)  
Old 04-15-08, 13:58
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Sorry, what source code are we talking about?
If you mean; "can I copy and paste the SQL from the query"; then to some extent, yes.

However, the ASP will not know how to interpret your parameters (the prompts) so you will have to recode them in ASP.

If you get stuck post back and I'll try and help.
__________________
George
Twitter | Blog
Reply With Quote
  #5 (permalink)  
Old 04-15-08, 14:00
aa_86 aa_86 is offline
Registered User
 
Join Date: Feb 2008
Posts: 49
yes i have tried to copy and paste the access sql source code but when i try to test the quer i get the an eerror. how can i tell asp.net to allow the parameters?
Reply With Quote
  #6 (permalink)  
Old 04-15-08, 14:18
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Post the SQL and ASP code please.
__________________
George
Twitter | Blog
Reply With Quote
  #7 (permalink)  
Old 04-15-08, 14:24
aa_86 aa_86 is offline
Registered User
 
Join Date: Feb 2008
Posts: 49
PARAMETERS [Select date from] DateTime, [Select date to] DateTime, [Please select vehicle] Text ( 255 );
SELECT Booking.[Booking ID], Booking.[Customer No], [Booking Details].[Vehicle Reg No], [Booking Details].[Date From], [Booking Details].[Date To], IIf(IsNull(VehicleBooked(-999,[Vehicle Reg No],[Date From],[Date To])),"Available","Not available") AS Availability
FROM Booking INNER JOIN [Booking Details] ON Booking.[Booking ID] = [Booking Details].[Booking ID]
WHERE ((([Booking Details].[Vehicle Reg No])=[Please select vehicle]) AND (([Booking Details].[Date From]) Between [Select date from] And [select date to])) OR ((([Booking Details].[Vehicle Reg No])=[Please select vehicle]) AND (([Booking Details].[Date To]) Between [Select date from] And [select date to]));

this is the sql code, i dont have asp code as i was using gridview and could not create the query, thanks
Reply With Quote
  #8 (permalink)  
Old 06-15-09, 08:46
julien_h julien_h is offline
Registered User
 
Join Date: Jun 2009
Posts: 1
hey , I'm having trouble with a task assigned to me

I have created a database on sql 2005 and I have made the connection with the sql datasource on the grid View .

the problem is that I can't figure out how to show what every " Author " has in terms of " books ".

I also can't figure out the appropriate code

can u plzzzz help me , it's kinda urgent and I'm stuck !!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On