GridView and Linq to SQL

0

I'm trying to change data in a GridView using a DataSource Linq to SQL Context:

I created a table in SQL: BancoID int Autoincremento Banknumber char (3) BankName varchar (30)

I created a Linq to SQL class and it includes access to this table.

In the Data Source window I read the Data Context Object for my table. I created a form and added a DataGridView. In the DataGridView I have changed the Datasource for this data source connection.

DataGridView recognized the columns in my table.

In the selection a System.Windows.Forms.BindingSource was created automatically

When I run and try to add data to the table, the DataGridView looks as if the data was being added, except for the BankID that is always 0.

But when I close the form and open it again I see that the data has not been written to the SQL table.

What do I need to do to work?

    
asked by anonymous 02.07.2017 / 16:21

0 answers