Solved

getting a parameter from the url

Posted on 2013-01-23
4
311 Views
Last Modified: 2013-01-23
I am trying to get the value of the parameter in the url so I can pass it to my sql statement located in my aspx page- does anyone know how to do that
<asp:SqlDataSource runat="server" ID="UserDD" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                               SelectCommand=" Select useruid, FirstNm + '' + LastNm as username from PLMUser where useractive = 1 AND UserUID <> @mgruseruid And UserUID not in(select staffuseruid FROM PLMManagerStaff WHERE mgruseruid = @mgruseruid">
                <SelectParameters>
                    <asp:Parameter Name="mgruseruid" Type="Int32" DefaultValue=<%#Convert.ToInt32(Request["MID"])%>/>
                </SelectParameters>
    </asp:SqlDataSource>

Open in new window

0
Comment
Question by:r3nder
  • 3
4 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 38811770
Request.QueryString["MID"]
0
 
LVL 35

Expert Comment

by:YZlat
ID: 38811778
<SelectParameters>
      <asp:QueryStringParameter Name="mgruseruid" QueryStringField="MID" />
 </SelectParameters>
0
 
LVL 35

Accepted Solution

by:
YZlat earned 500 total points
ID: 38811789
<asp:SqlDataSource runat="server" ID="UserDD" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                               SelectCommand=" Select useruid, FirstNm + '' + LastNm as username from PLMUser where useractive = 1 AND UserUID <> @mgruseruid And UserUID not in(select staffuseruid FROM PLMManagerStaff WHERE mgruseruid = @mgruseruid">
                <SelectParameters>
                    <asp:QueryStringParameter Name="mgruseruid" QueryStringField="MID" />

                </SelectParameters>
    </asp:SqlDataSource> 

Open in new window

0
 
LVL 6

Author Closing Comment

by:r3nder
ID: 38811864
Thank you YZlat
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now