Solved

How do I add a textbox to a datacolumn?

Posted on 2011-02-10
1
582 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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