Problem with query Parameter/variable

  • Thread starter Thread starter SF
  • Start date Start date
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
 
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
 
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
 
Back
Top