Click here to Skip to main content
15,923,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i pass category and imgId in the query string like this..

http://localhost:56393/FunEvilModi/ViewItem.aspx?Cat=Birthday&ImgId=B100[^]

in page lode

DataSet DSImages = new DataSet();
DSImages.ReadXml(Server.MapPath(@"~\\xml\\"+Request.QueryString[0].ToString()+".xml"));

\\This line Gives Error
DataRow DRow  = DSImages.Tables[0].Select("imgId=" + Request.QueryString[1].ToString())[0];

\\This line gives error
ImgItem.ImageUrl = "~/greetings/"+DRow[1].ToString();

In XML file i store the ImgId,IMgURL
i want display the image based on imgId

it Gives error like this

"Exception Details: System.Data.EvaluateException: Cannot find column [B100]."
Posted
Updated 20-Apr-10 7:44am
v2

1 solution

Rajesh Kumar Chekuri wrote:
DataRow DRow = DSImages.Tables[0].Select("imgId=" + Request.QueryString[1].ToString())[0];


You need to pass the value within single quotes

DSImages.Tables[0].Select(string.Format("imgId='{0}'", Request.QueryString[1].ToString())[0]);


Rajesh Kumar Chekuri wrote:
Server.MapPath(@"~\\xml\\"+Request.QueryString[0].ToString()+".xml"));


You need not specify \\ as you have given @. Also it would make it easier to read if you used string.Format(@"~\xml\{0}.xml", Request.QueryString[0].ToString());.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900