Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating A Demo Version in C# Pin
fjdiewornncalwe25-Feb-11 4:57
professionalfjdiewornncalwe25-Feb-11 4:57 
GeneralRe: Creating A Demo Version in C# Pin
Espen Harlinn25-Feb-11 5:09
professionalEspen Harlinn25-Feb-11 5:09 
GeneralRe: Creating A Demo Version in C# Pin
varun.g25-Feb-11 18:36
varun.g25-Feb-11 18:36 
GeneralRe: Creating A Demo Version in C# Pin
Espen Harlinn25-Feb-11 23:21
professionalEspen Harlinn25-Feb-11 23:21 
GeneralRe: Creating A Demo Version in C# Pin
varun.g26-Feb-11 0:05
varun.g26-Feb-11 0:05 
QuestionImage Compression algorithm in c# Pin
Nidhu603224-Feb-11 18:26
Nidhu603224-Feb-11 18:26 
AnswerRe: Image Compression algorithm in c# [modified] Pin
SledgeHammer0124-Feb-11 18:53
SledgeHammer0124-Feb-11 18:53 
QuestionI want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
Nadia Monalisa24-Feb-11 13:52
Nadia Monalisa24-Feb-11 13:52 
Hello,

I realize that, DatabaseContext class generated by LINQ to SQL / LINQ to ENTITY should not be a part of the Views and so I want to encapsulate the uses of DatabaseContext classes within my Data Access Layer. So, when I need to display a set of records in a GridView in Windows Form, I can simply let my Data Access Layer return the List<Person> of the records and display that records in GridView without any problem. Great!

Here is my Person class

public class Person
{
  public string FirstName { get; set; }
  public string LastName { get; set; }
}


Ok, now, I face the big problem when I need to save the changes back to the database. I may have 1000 records displaying in the Grid view where the GridView is bound to a BindingSource. My user can change only 2-3 records from the GridView and delete some of the records as well. How can I tell the LINQ to SQL / LINQ to Entity (data context) about the changed records so that when I pass the List<Person> object to my Data Access Layer, Data Access Layer can identify which records needs to be updated and finally the Data Context updates those records ?

Can you please show me some pattern for this problem ?

Regards.
AnswerRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
PIEBALDconsult24-Feb-11 14:09
mvePIEBALDconsult24-Feb-11 14:09 
GeneralRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
Nadia Monalisa24-Feb-11 14:56
Nadia Monalisa24-Feb-11 14:56 
GeneralRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
PIEBALDconsult25-Feb-11 1:47
mvePIEBALDconsult25-Feb-11 1:47 
AnswerRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
N a v a n e e t h24-Feb-11 16:51
N a v a n e e t h24-Feb-11 16:51 
GeneralRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
Nadia Monalisa24-Feb-11 17:16
Nadia Monalisa24-Feb-11 17:16 
GeneralRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
N a v a n e e t h24-Feb-11 17:22
N a v a n e e t h24-Feb-11 17:22 
GeneralRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
Nadia Monalisa24-Feb-11 17:58
Nadia Monalisa24-Feb-11 17:58 
AnswerRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
_Maxxx_24-Feb-11 18:04
professional_Maxxx_24-Feb-11 18:04 
GeneralRe: I want to detach the LINQ to SQL / LINQ to Entity Data Context from my presentation layer Pin
Nadia Monalisa24-Feb-11 18:13
Nadia Monalisa24-Feb-11 18:13 
QuestionMSSQL and C# ;( Pin
csrss24-Feb-11 13:11
csrss24-Feb-11 13:11 
AnswerRe: MSSQL and C# ;( Pin
csrss24-Feb-11 14:20
csrss24-Feb-11 14:20 
AnswerRe: MSSQL and C# ;( Pin
Henry Minute24-Feb-11 14:37
Henry Minute24-Feb-11 14:37 
GeneralRe: MSSQL and C# ;( Pin
csrss24-Feb-11 15:45
csrss24-Feb-11 15:45 
QuestionListview sorting by group of items Pin
fady_sayegh24-Feb-11 4:43
fady_sayegh24-Feb-11 4:43 
AnswerRe: Listview sorting by group of items Pin
Luc Pattyn24-Feb-11 5:15
sitebuilderLuc Pattyn24-Feb-11 5:15 
GeneralRe: Listview sorting by group of items Pin
fady_sayegh24-Feb-11 5:29
fady_sayegh24-Feb-11 5:29 
GeneralRe: Listview sorting by group of items Pin
Luc Pattyn24-Feb-11 5:34
sitebuilderLuc Pattyn24-Feb-11 5:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.