Sending data to User Control from SqlDataSource

J

JMO

I'm trying to retreive specific column data from a SqlDataSource
declared on my aspx page. In turn I want to declare the specific data
to a variable and then send it to a User Control. The only part that
I can't get is just being able to retreive the data from the
SqlDataSource control. I have a custom parameter specified below the
control as well. If someone could help me out w/ my existing code or
provide me with a good alternative that would be very helpful. Thanks
in advance!

Here is my code:

aspx

<%@ Register Assembly="skmParameters" Namespace="skmParameters"
TagPrefix="skm" %>

<asp:SqlDataSource ID="HeaderDS" runat="server" ConnectionString="<%$
ConnectionStrings:MGLoginConnectionString %>"
DataSourceMode="DataReader"
SelectCommand="SELECT Fund_Attributes.Fund,
UserInfo.FundName, UserInfo.FirstName, UserInfo.UserId,
Fund_Attributes.Logo FROM UserInfo INNER JOIN Fund_Attributes ON
UserInfo.FundName = Fund_Attributes.Fund WHERE (UserInfo.UserId =
@UserId)">
<asp:parameter Name="FirstName" Type="String" / </SelectParameters>

codebehind .cs

void Page_Load(object sender, EventArgs e)
{

SqlDataReader reader =
(SqlDataReader)HeaderDS.Select(DataSourceSelectArguments.Empty);


while (reader.Read())
{
uID = reader["FirstName"].ToString() + "!";
Fund = reader["Fund"].ToString();
Logo = reader["Logo"].ToString();
}
reader.Close();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top