I'd like to extract a column from a dataGridView and add it to a dataSet. Apparently I can't cast a dataGridViewColumn to a dataColumn like this DataColumn col = (DataColumn)inputGrid.Columns[0]; even though they seem like they're holding essentially the same thing. Any suggestions you have would be great, I'm still new to C# and DataGridView is giving me the most trouble.

Recommended Answers

All 3 Replies

An apple an a pear are both fruits. You can even say that they belong to the same plant family http://en.wikipedia.org/wiki/Rosaceae
You can never say an apple IS a pear.

OK. How do I make my code work?

I'm no expert in ADO but I think you should look for DataBinding.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.