Getting a variable from URL and passing it into SqlDataSource SelectCommand

TrusiorJusy

New Member
"I am working in asp.net vb and I am trying to get a variable from the URL and pass it into the select statement of my sql data source. So far I have this and it doesn't work with asp.net.\[code\] <%Dim PersonNumId as String PersonNumID = Request.QueryString("Person") Dim PersonNum2 PersonNum2 = Convert.ToInt32(PersonNumID)%> <aspSqlDataSource (other information required) SelectCommand="Select Name From Interests Where ID=@PersonNumID" /> <SelectParameters><asp:QueryStringParameter DefaultValue="http://stackoverflow.com/questions/13732975/<%=PersonNum2%>" DbType=Int32/></SelectParameters\[/code\]I have tried several different ways of converting it but I need the end result to be the variable that is in the query statement is an int. I am new to this so any advice would be greatly appreciated!
 
Back
Top