By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Problem with query Parameter/variable

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a

"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.