Skip to main content
Inspiring
September 18, 2006
Question

SQL Query Problem (ASP.NET)

Using DW 8, ASP.NET 2.0

Using the built-in Dreamweaver DataSet, I created a SQL call:

SELECT tblScreens.ID, tblScreens.Filename, tblScreens.Width,
tblScreens.Height, tblScreens.PlayerVersion
FROM tblScreens
WHERE tblScreens.ID = myID

Using the "build" button, I created a parameter

Name: myID
Type: Int
Value: ((Request.QueryString["ID"] != null) &&
(Request.QueryString["ID"].Length > 0)) ? Request.QueryString["ID"] : "10"

I'm getting errors when testing

System.Data.SqlClient.SqlException: Invalid column name 'myID'.
...
...

I don't know how I'm supposed to set the comparison on this line:
WHERE tblScreens.ID = myID

because it obviously is having problems there.

Any help is much appreciated.

- Chris




This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Inspiring
September 18, 2006
Nevermind...I needed to name my variable @myID and it worked fine.


Translate