Solved

Select Parameter in ASP.net Object Data Source

Posted on 2009-06-30
2
297 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 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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