Solved

How do I add a textbox to a datacolumn?

Posted on 2011-02-10
1
581 Views
Last Modified: 2012-05-11
I'm trying to add a datacolum of type textbox.  It errors on line 3 saying "Column requires a valid DataType."

1            // Notes
 2           dc = new DataColumn();
3            dc.DataType = Type.GetType("System.Web.UI.WebControls.TextBox");
4            dc.ColumnName = "Notes";
5            dtFiles.Columns.Add(dc);

Any ideas?
0
Comment
Question by:JT_SIRO
1 Comment
 
LVL 15

Accepted Solution

by:
jorge_toriz earned 250 total points
ID: 34868293
You can't add a textBox as a DataColumn, because it doesn't make any sense, you can't hold TextBox data in a database... I think you should add a templated column in your FormView, GridView or DetailsView control that, I suppose, you are using.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

778 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