Problem with query Parameter/variable

S

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
 
M

Mike

SF said:
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
 
S

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top