Popular Posts

Wednesday, May 23, 2012

Compare two datatable using LINQ Query - CodeProject

The LINQ .Except function compares the references if you are trying to find rows that are in Table1 and not in Table2 and therefore never returns correct value. To get around this issue we need to create to tables with columns and then use them using the except:


        Dim allAccountsBrief = accounts.AsEnumerable().[Select](Function(a) New With
                                                                            {Key .AccountKey = a.Item("AccountKey").ToString()})
        Dim linkedAccountsBrief = _LinkedAccounts.AsEnumerable().[Select](Function(a) New With
                                                                            {Key .AccountKey = a.Item("AccountKey").ToString()})
 
        Dim unLinkedAccountsBrief = allAccountsBrief.Except(linkedAccountsBrief)
 
        Dim unLinkedAccountsTable = (From a In accounts.AsEnumerable
                                        Join unlnked In unLinkedAccountsBrief
                                            On a.Item("AccountKey").ToString Equals unlnked.AccountKey
                                        Select a
                                    ).CopyToDataTable


Compare two datatable using LINQ Query - CodeProject:

'via Blog this'

Monday, May 7, 2012

Pipes and filters: The IEnumerable appraoch - Ayende @ Rahien

Pipes and Filters to create a Validation infrastructure for business objects. eg before performing an action the object to be passed through a set of validation rules that are registered with Business Object and after fully passing the pipline without errors then the action should be executed: ... Possible?

Pipes and filters: The IEnumerable appraoch - Ayende @ Rahien:

'via Blog this'

Saturday, May 5, 2012

SQL SERVER – Get the List of Object Dependencies – sp_depends and information_schema.routines and sys.dm_sql_referencing_entities « SQL Server Journey with SQL Authority

Good way to find out the dependencies on an object:

SELECT referencing_schema_namereferencing_entity_name,referencing_idreferencing_class_descis_caller_dependentFROM sys.dm_sql_referencing_entities ('dbo.Person''OBJECT');GO

SQL SERVER – Get the List of Object Dependencies – sp_depends and information_schema.routines and sys.dm_sql_referencing_entities « SQL Server Journey with SQL Authority: "SELECT referencing_schema_name, referencing_entity_name,
referencing_id, referencing_class_desc, is_caller_dependent
FROM sys.dm_sql_referencing_entities ('dbo.First', 'OBJECT');
GO"

'via Blog this'

Ruslan Trifonov's blog: Sql Server 2005: Change schema for all tables

change schema of all tables in one go

Ruslan Trifonov's blog: Sql Server 2005: Change schema for all tables: "exec sp_MSforeachtable "ALTER SCHEMA new_schema TRANSFER ? PRINT '? modified' ""

'via Blog this'

How to design a unit testable domain model with Entity Framework Code First – Daniel Cazzulino's Blog

A different approach than generic repository - kzu way ;-)

How to design a unit testable domain model with Entity Framework Code First – Daniel Cazzulino's Blog:

'via Blog this'

Generic Repository for Entity Framework 4.1 « Code, Wine, and IT

An implementation of the Generic Repository:

Generic Repository for Entity Framework 4.1 « Code, Wine, and IT:

'via Blog this'