Forum Moderators: open
I am stuck at a point where I would use a Recordset Query in Bindings to check a URL Parameter in the database. I would then have used the Recordset result to diplay 2 different pages depending if the result was empty or not empty.
Could someone please explain the equivalent of how to acheive this in Visual Studio 2008 C#? :(
If I understand correctly you would like to achieve the following:
A URL may or may not have a Querystring parameter, and you want to query the database with the given parameter, ie:
www.example.com/user.aspx?username=freeriderDaz
One option, which is an easy way of doing it is to do the following
- Add a Data aware control (such as a GridView) to the page.
- In design view, click on the control and then on the Arrow button, and in the menu that appears select <new data source...>
- Select the Database Data source type, and click OK
- Build your connection string (or select an existing one)
- Create your Query
- Now you can select Query parameters, this can come from a QueryString, a Form control, play around with the options.
Here are some great video tutorials as well:
[asp.net...]