Solved

Select Parameter in ASP.net Object Data Source

Posted on 2009-06-30
2
294 Views
Last Modified: 2012-05-07
Hello,
I have one ASP.NET web form that contain an Object Data Source OSD, and one Detail View.

The OSD is bound to a VB function that takes the user name in parameter to return specific data.

So, on the Page_Load event i wrote :

rODS.SelectParameters = User.Identity.Name

but it's not working, how can i get the ODS to select data regarding the userName when the page is on.
thanks
0
Comment
Question by:Nyana22
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 24747123
Try this:
In Page_Load
ObjectDataSource1.SelectParameters("UserName")= User.Identity.Name

OR This:
In Selecting Event of ODS:

Protected Sub rODS_Selecting _
    (sender As Object, e As ObjectDataSourceSelectingEventArgs) _
        Handles ObjectDataSource1.Selecting
    e.InputParameters("UserName") = User.Identity.Name
End Sub

FYI: http://www.asp.net/learn/data-access/tutorial-06-vb.aspx
0
 

Author Closing Comment

by:Nyana22
ID: 31598400
Thanks
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.net Have sliders change in order 2 23
ASP.net 2015 Syncing Azure web app projects on two machines 2 20
Disable extension 8 38
ASP.NET MVC identity 6 26
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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