?
Solved

Select Parameter in ASP.net Object Data Source

Posted on 2009-06-30
2
Medium Priority
?
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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 …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 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