Simple, within the ObjectDataSource.Selecting event, set your UserName parameter like so:
Code:
protected void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["UserName"] = this.User.Identity.Name;
}
Not seeing your code, it's a little tough to see exactly what you're doing. However, if your using an ObjectDataSource, I'm assuming you have a Parameter set up declaratively within your ObjectDataSource like so:
Code:
<asp:objectdatasource id="ObjectDataSource1" runat="server" onselecting="ObjectDataSource1_Selecting">
<selectparameters>
<asp:parameter name="Username" type="String" />
</selectparameters>
</asp:objectdatasource>
Then, with the Selecting event declared in the ObjectDataSource as above, the Selecting event will fire right before the code within your select method is fired. In this event, we extract the currently logged-in user's username from the Page's IPrincipal object. Your Parameter is then set to this value. With this, your select method will now be passed the appropriate username which can be used to inject into your SQL query or added as a parameter.