TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Scott McGlothlin
NA
34
0
Problem adding DataGridViewTextBoxColumn to datatable
Mar 8 2009 12:35 PM
I have tried any number of ways to include a DataGridViewTextBoxColumn in the datatable, to no avail. The column adds just fine to the DataGridView, just not the underlying datatable. This is what I have now:
DataColumn marg = new DataColumn("marg", typeof(decimal));
dt.Columns.Add("marg");
DataGridViewTextBoxColumn textBoxMarg = new DataGridViewTextBoxColumn();
textBoxMarg.DataPropertyName = "marg";
textBoxMarg.Name = "textBoxMarg";
textBoxMarg.HeaderText = "NEW MARGIN";
textBoxMarg.Width = 62;
dataGridView1.Columns.Add(textBoxMarg);
I am using a "foreach" loop to search for the added column and it's not there. Nor can I reference it when trying to insert it's value to the database.
foreach (DataTable table in ds1.Tables)
{
foreach (DataColumn column in table.Columns)
{
MessageBox.Show("column", Convert.ToString(column));
}
}
Ultimately the user will enter desired margin and I need to insert that value into a SQL table to use with a stored procedure.
Any direction here would be much appreciated, as I'm starting to wear a flat spot on my forehead over this one.
Reply
Answers (
1
)
how to obtain SQL Server FullText Search service?
Store unicode data