General .NETFor general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category.
** PLEASE BE SPECIFIC WITH YOUR QUESTION **
When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I'm building a site for a non-profit that lets each participant in its program create a personalized page. The page has a bunch of labels filled by a datareader with the participant's name, fundraising goal, etc. There also needs to be an area that lists all the people who've donated to the participant and the amounts they donated. The thing is, if there are a lot of donors this list could get very long so it needs to be contained so it doesn't take up a ton of space (i.e. put the list of donors in a multiline textbox that allows the whole list to be scrolled up and down).
Is there a way to put a datalist inside a textbox or textarea or to fill a textbox w/ the info from a datalist?
Might using html controls instead of asp:textbox work? I'm fairly new to programming so please don't assume I know anything beyond the bare basics.
If the datalist is populated from the database,use the datareader and use the below logic to fill the textbox.
Here strRead is the DataReader object and in the table i have only two columns.
if(strRead.HasRows)
{
TextBox1.Rows =strRead.FieldCount ;
while (strRead.Read())
{
TextBox1.Text = TextBox1.Text +" " +strRead.GetValue(0) +" ," + strRead.GetValue(1);
}
}
If strRead.HasRows Then
TextBox1.Rows =strRead.FieldCount
Do While strRead.Read()
TextBox1.Text = TextBox1.Text &" "& strRead.GetValue(0) &" ," & strRead.GetValue(1)
Loop
End If