• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 525
  • Last Modified:

How to save changes from a datagridview to a SQL Server 2008 database using Linq to SQl

I have a VS 2010 windows form application, where the user can edit/add new rows into a datagridview. I use Linq to SQL to populate the datagridview with the existing data from the database. My question is when the user clicks on the Save button, how do I write the changes and/or new data entered back to the database, using Linq to SQL?

Below is the c# code I use to populate the datagridview.
OperationsDataContext opDC = new OperationsDataContext();

                dgTime.DataSource = opDC.Tasks_GetByProjectIDAndWeekEndingDate(Convert.ToInt32(cboTimeProject.SelectedValue), dtWeekEnding.Value);

                dgTime.AutoResizeColumns();

Open in new window

TimeEntryScreen.png
0
jjliu4492
Asked:
jjliu4492
  • 2
1 Solution
 
Anurag ThakurTechnical ManagerCommented:
0
 
jjliu4492Author Commented:
0
 
jjliu4492Author Commented:
I found the solution using google.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now