Using: ASP.NET 4, SQL 2008, C#
I’m writing a web app for our projects team to keep track of special project users. One thing they have asked is to export quick lists of data that they use often. For instance, what I’m trying to do here is give the team a button which will populate a TextBox with all the various email addresses that are saved in our SQL DB.
What I’ve been trying to do is bind the TextBox to a specific column in the DB. I already have a connection to the DB, and I’ve built a DataSet that queries for that specific column, and it works normally.
My question is, how do I tell ASP.NET to use the data from the DataSet to populate the Textbox? Here is the code I’m working with so far:
protected void btnGetNPMEmailAddresses_Click(object sender, EventArgs e)
{
txbResults.Text = "";
txbResults.DataBind(ObjectDataSource_Designee_EmailAddresses) // ??? My DataSet
}
I’m definitely crawling my way up the C# learning curve. Any help would be greatly appreciated!
Thanks,
Paul D.
Try something like this: