Solved

How do I add a textbox to a datacolumn?

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now