473,473 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem with query Parameter/variable

SF
Hi,

I am new to ASP.NET. I started my first testing ASP.NET by having a ASP page
consist of a drop-down control and 1 datagrid bound to Access database. The
dropdown control works very well except the datgrid becuase I want to limit
the datgrid to display only information selected in the dropdown control.
For this purpose I have create a dataset having a query that would serve as
source to datagrid. I am unable to specify the parameter for access query
(@ContactID). I know that It works well with SQL Server. Does anybody
suggest something (why my @ContactID does not accept by Access query)?

SF
Feb 17 '07 #1
2 2397

"SF" <ss@yahoo.comwrote in message
news:uJ*************@TK2MSFTNGP05.phx.gbl...
Hi,

I am new to ASP.NET. I started my first testing ASP.NET by having a ASP
page
consist of a drop-down control and 1 datagrid bound to Access database.
The
dropdown control works very well except the datgrid becuase I want to
limit
the datgrid to display only information selected in the dropdown control.
For this purpose I have create a dataset having a query that would serve
as
source to datagrid. I am unable to specify the parameter for access query
(@ContactID). I know that It works well with SQL Server. Does anybody
suggest something (why my @ContactID does not accept by Access query)?
Show the SQL you are attempting to run against Access that deosn't work.

Mike
Feb 18 '07 #2
SF
Dear Mike,

In the Dataset, I have created the following query:

SELECT tblTargetCommunes.TargetCommuneID AS ID,
tblProvinces.Pv_Province_e AS Province, tblTargetCommunes.TC_Year AS [Year],
tblTargetCommunes.TC_ContactID
FROM (tblProvinces INNER JOIN
tblTargetCommunes ON tblProvinces.Pv_ProvinceID =
tblTargetCommunes.TC_ProvinceID)
WHERE (tblTargetCommunes.TC_ContactID = @ID)

The error come from @ID. I also use [ID], but it does not work either

"Mike" <mi**@dotnet.comwrote in message
news:eD**************@TK2MSFTNGP04.phx.gbl...
>
"SF" <ss@yahoo.comwrote in message
news:uJ*************@TK2MSFTNGP05.phx.gbl...
>Hi,

I am new to ASP.NET. I started my first testing ASP.NET by having a ASP
page
consist of a drop-down control and 1 datagrid bound to Access database.
The
dropdown control works very well except the datgrid becuase I want to
limit
the datgrid to display only information selected in the dropdown control.
For this purpose I have create a dataset having a query that would serve
as
source to datagrid. I am unable to specify the parameter for access query
(@ContactID). I know that It works well with SQL Server. Does anybody
suggest something (why my @ContactID does not accept by Access query)?

Show the SQL you are attempting to run against Access that deosn't work.

Mike

Feb 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Cocker | last post by:
Hello, I'm quite weak at PHP, so I was hoping to get some help understanding the below code. First off, I'm trying to create a "query form" that will allow me to display the results on my...
5
by: Aamer Nazir | last post by:
Hi, I am having problems setting the value of a variable in a SQL String that I have to create dynamically in my procedure. The code that I currently have is as follows: set...
7
by: rickcheney | last post by:
I just changed my Access 2002 database to a SQL Server ADP project. I had a form where the user entered a value into a text box and when a command button on the form was clicked a Report was...
5
by: MX1 | last post by:
Simpler way to ask question from my previous post. I wrote a query and it has a paramter field in it. I want to enter a date with the current year. If it I put in 6/30/2003, it works great. If I...
4
by: Judy | last post by:
I'm using Access 2003 and was wondering if it is possible to have a paramater selection within a crosstab query so that I wouldn't need to build a new table. I have a select query that I'm using...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
29
by: wizofaus | last post by:
I previously posted about a problem where it seemed that changing the case of the word "BY" in a SELECT query was causing it to run much much faster. Now I've hit the same thing again, where...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
6
by: Carsten | last post by:
Hello Folks, I encountered a problem with SQL server 2000 and UDFs. I have a scalar UDF and a table UDF where I would like the scalar UDF to provide the argument for the table UDF like in: ...
2
by: RoomfulExpress | last post by:
The only problem I'm having with this code is when there are no values returned for the query, it is still allowing you to see and click the 'Next>>'. It disappears when there is at least one return...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.