Hi vadym
Thanks for all info, however here is my code ::::
string var = this.Request.QueryString["midcateid"];
// replace the database connection information here with
your own login information
SqlConnection conn = new
SqlConnection(System.Configuration.ConfigurationSe ttings.AppSettings["ConnectionInfo"]);
SqlCommand comm = new SqlCommand("SELECT DISTINCT hdetails
FROM Hofftable",conn);
SqlDataReader dr;
I have used the query string to bring the record autoid from prev page
and it is a numeric value. so if I capture it as a string, wont id give
me a problem while adding in my SQL cmd ie..
SELECT DISTINCT hdetails FROM Hofftable Where adminlock = 1 AND autoid
=" + var,conn);
?????
pls help
regrds
Vadym Stetsyak wrote:
Hello, g_******@yahoo.com!
the text after '?' is referred to as querystring.
In asp.net page to access query string you can use HttpRequest class.
The code can be like this
//Page_Load
string var = this.Request.QueryString["mid"];
int midVal;
if ( var != null && vat.Length 0 )
{
if (!int.TryParse(var, out midVal) )
{
//report error
}
}
gI am freelancer and designing a .net page.
gI require the syntax in C# for capturing the variable from carryover
gline in url eg: www.xyz.com/ccc.aspx?mid=12
ghow to capture this mid in c# and I have to use in my sql string
galong
gwith Select * from Tbname where mid = 12.
gcan yu pls help me with the syntax of this problem
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com