Solved

How do I add a textbox to a datacolumn?

Posted on 2011-02-10
1
583 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 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