Solved

getting a parameter from the url

Posted on 2013-01-23
4
310 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
Comment Utility
Request.QueryString["MID"]
0
 
LVL 35

Expert Comment

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

Accepted Solution

by:
YZlat earned 500 total points
Comment Utility
<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
Comment Utility
Thank you YZlat
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…

743 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

16 Experts available now in Live!

Get 1:1 Help Now