What is wrong here..
-
Hi guys what is wrong her keep getting this error: " Parameterized Query '(@type nvarchar(4000))select price from titles where type=@type' expects parameter @type, which was not supplied " I think it's something to do with my QueryString, which seems to be null, but I don't know how to fix it - any suggestions please.... Here is a code snippet: strType = Request.QueryString["type"]; //using pubs database strSelect = "select price from titles where type=@type"; cmdTitles = new SqlCommand( strSelect, conPubs ); cmdTitles.Parameters.Add("@type", strType); conPubs.Open(); rptTitles.DataSource = cmdTitles.ExecuteReader(); rptTitles.DataBind(); conPubs.Close(); All the best Al
-
Hi guys what is wrong her keep getting this error: " Parameterized Query '(@type nvarchar(4000))select price from titles where type=@type' expects parameter @type, which was not supplied " I think it's something to do with my QueryString, which seems to be null, but I don't know how to fix it - any suggestions please.... Here is a code snippet: strType = Request.QueryString["type"]; //using pubs database strSelect = "select price from titles where type=@type"; cmdTitles = new SqlCommand( strSelect, conPubs ); cmdTitles.Parameters.Add("@type", strType); conPubs.Open(); rptTitles.DataSource = cmdTitles.ExecuteReader(); rptTitles.DataBind(); conPubs.Close(); All the best Al
ComCoderCsharp wrote:
strType = Request.QueryString["type"];
Make sure this is returning something.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo