How to request querystring

B

Bob

I'm a Visual Studio 2005 beginner and trying to make a dataset to query a
newsstory. The url to the story looks like this news.aspx?ID=1.

I'm using Access DB and I made a query there which looks like this
SELECT articles.ArticleID articles.Titel, articles.Story
FROM articles
WHERE articles.ArticleID = @ID;

My question is how I make a dataset in Visual Studio which will do this? Any
tutorials or something to guide me along? Pasting the sql above gives an
error so I guess I must be missing something.
 
I

intrader

I'm a Visual Studio 2005 beginner and trying to make a dataset to query a
newsstory. The url to the story looks like this news.aspx?ID=1.

I'm using Access DB and I made a query there which looks like this
SELECT articles.ArticleID articles.Titel, articles.Story
FROM articles
WHERE articles.ArticleID = @ID;

My question is how I make a dataset in Visual Studio which will do this? Any
tutorials or something to guide me along? Pasting the sql above gives an
error so I guess I must be missing something.

I like ASP.NET Unleashed; lots of good examples.
 
N

Nathan Sokalski

I think the reason for your error is the fact that you are mixing SQL code
with other code. Try rewriting your code like this:

"SELECT articles.ArticleID,articles.Title,articles.Story FROM articles WHERE
articles.ArticleID=" & Request.QueryString("ID")

See if this solves your problem. If not, let me know. You are also more
likely to get better help sometimes if you copy and paste the actual error
text in the posting, it gives people more information to work with. Good
Luck!
 
N

Nathan Sokalski

I have to support you on that, ASP.NET Unleashed is probably the best book I
have ever bought. I found the example-based teaching style to be very
helpful in understanding, and I think that the book must have increased my
ASP.NET skills ten-fold, if not more. I don't know what I would have done
without it, it's an ASP.NET developer's best friend.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top