|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: Calgary, Canada
Posts: 4,012
|
Simple ASP.NET C# Question
Greetings guys, maybe somebody can help. I am working with C#.
This is what I got: <% string MyVar; // define a variable MyVar = Request.QueryString["MyVar_url"]; // add value %> I am trying to grab the MyVar_url value from the URL and asign it to the MyVar varaible. I want to add it to a to this later one... SelectCommand="SELECT * FROM users WHERE user_id = @ MyVar " But that is the second step. Any help would be appreciated. |
|
|
|
|
|
#2 |
|
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: Calgary, Canada
Posts: 4,012
|
I think I am mixing run time code with compiled stuff. Umpf!
|
|
|
|
|
|
#3 |
|
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
Is this for a school project or something?
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
|
|
|
|
|
#4 |
|
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: Calgary, Canada
Posts: 4,012
|
It is for me to learn a little ASP.NET C#
|
|
|
|
|
|
#5 |
|
Confirmed User
Join Date: Jul 2003
Location: chicago
Posts: 1,135
|
old post, but if you're using sql server it would look something like this....
Code:
<%
string MyVar = Request.QueryString["MyVar_url"];
...
SqlConnection sqlConn = new SqlConnection(connectionString);
sqlConn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM users WHERE user_id = @MyVar", sqlConn);
cmd.Parameters.Add("@MyVar", SqlDbType.Int).Value = int.Parse(MyVar);
SqlDataReader result = cmd.ExecuteReader();
sqlConn.Close();
%>
|
|
|
|