Linq to SQL - DataGridView

D

Dan Tallent

I'm having a problem making the leap from working with queries to connecting
them to a datagridview for use.


I have been able to setup a grid and set its bindingsource so it correctly
displays the data when I apply the query to the bindingsource using code
like:

this.MaterialBindingSource.DataSource = Mats;

where Mats is defined as IEnumerable < Material > and is populated by
executing a Linq Query against the SQL database.

This method even allows me to modify any of the data and update the SQL
database by using the SubmitChanges method of the DataContext.

The problem I'm having is I've been unable to figure out how to add new rows
using the grid or through code.

Any help filling in the gaps here will be most appreciated.

Thanks
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top