DCSIMG
.Net Framework 3.5 - Wortzel's blog

Wortzel's blog

.Net (2.0, 3.0, 3.5), C#, Asp.net, Com+, GIS(ESRI Software), Management, Analysis & Design, Life, Trips, And more...

Browse by Tags

All Tags » .Net Framework 3.5 (RSS)
Implementing SqlBulkCopy in Linq to Sql
As I already mentioned in one of my previous post , the SqlBulkCopy is a powerful tool which gives us an option to perform insertion for a large amount of data. The evolution of the ADO.NET creates us the Linq to Sql, as a great O/R Mapping framework from Microsoft kitchen. One of the missing features in Linq to Sql is the ability to use some bulk insert capabilities. In order to improve our Linq to Sql infrastructure I decided to implement the bulk insert as part of the Table class, and I will show...

Posted Tuesday, May 06, 2008 12:30 AM by Avi Wortzel | 8 comment(s)

Testing LINQ to SQL with Mock Object – a complete solution
For the last few weeks I was looking for a complete solution to implement LINQ to SQL in our system. Before I started the searching process I have defined to myself some basic requirements from it: · Rapid development in at least 80% of the cases. · Easy to use , understandable API. · Migration plain or good solution to work with our legacy code . · Easy to maintenance . · Testability framework! One of the major disadvantages of the LINQ to SQL framework is the difficult to test it. If you’ll try...

Posted Tuesday, March 25, 2008 6:18 PM by Avi Wortzel | 1 comment(s)

Pro LINQ: Language Integrated Query in C# 2008 by Joseph C. Rattz, Jr.
In the last few months I started to learn one of the great frameworks from Microsoft named LINQ. In order to get a better understand about the LINQ framework I read a lot from the official Microsoft documentation. I even shared people in my thoughts about the LINQ project (I focused on LINQ to SQL with its pervious name D-LINQ), in my blog . After a while I took a time to read the "Pro LINQ" book . This book exposes me to some fundamentals in the LINQ world which I wasn't familiar with...

Posted Friday, January 18, 2008 9:36 AM by Avi Wortzel | 2 comment(s)

Visual studio 2008 (aka "Orcas") and .Net framework 3.5 will ship until the end of this month
Two team leaders in my workplace have arrived from TechEd Developers in Barcelona last week. They told me that Microsoft announce that the next release of Visual studio 2008 (aka "Orcas") and .Net framework 3.5 will take place at the end of this month! (The original release date was at February 2008). You can see this announce in the visual studio developer center main page : " Countdown to Visual Studio 2008 In his keynote address at TechEd Developers in Barcelona, S. "Soma"...

Posted Thursday, November 15, 2007 8:43 AM by Avi Wortzel | with no comments

DLINQ – Advanced topics – Debug mode – part 6
DLINQ is a great ORM engine with a lot of advantages. When I learned this tool I asked myself how I can look at the SQL code that it generates. At the beginning I did it by running my project in debug mode with a break point after the query statement. The SQL statement appears when we hover over the result object or by using the watch window. Debugging using the default hover debug tool Debugging using the watch window As you can see it isn't the most comfortable way to look at the generated SQL...

Posted Friday, August 24, 2007 12:38 AM by Avi Wortzel | with no comments

DLINQ – Advanced topics – How it works in ASP.NET application – part 5
There are two approaches to work with the DataContext object. The first approach is to work with a single DataContext object which is responsible for all the quires and the manipulations in our system. In the second approach we work with several DataContext object. Each request refer to a single atomic operation and will work independency to others operation (The DataContext isn't aware to the previous operations at the current entity). The ASP.Net is a good example for the second approach because...

Posted Friday, August 17, 2007 4:18 PM by Avi Wortzel | with no comments

DLINQ – Advanced topics – Transaction support – part 4
As I have mention before the DLINQ is a part of the ADO.NET family and this is a major reason for it to support transaction mechanisms. The DLINQ support the ADO.NET Transaction and the transaction scope. Let's see how we can use it at the following scenarios: ADO.NET Transaction At ADO.NET Transaction we have to handle the entire transaction process. It includes: opening a connection, starting the transaction, commit and rollback when needed, finish the transaction and close the connection. In a...

Posted Monday, August 13, 2007 8:45 PM by Avi Wortzel | with no comments

Introducing to DLINQ – How to write data manipulation in DLINQ (Update, insert and delete) - part 3
DLINK gives maximum flexibility in manipulation data with objects. You must retrieve the object before you update or delete it, and you must initialize a new object before inserting it into the db. Let's see some examples: Insert a new employee: MyDbDataContext db = new MyDbDataContext (); // Init a new employee object using Object Initializer Employee emp = new Employee () { Id = 10, Name = "New Employee" , DepartmentCode = 5 }; db.Employees.Add(emp); db.SubmitChanges(); You can see that I must...

Posted Friday, August 10, 2007 9:50 AM by Avi Wortzel | 2 comment(s)

Introducing to DLINQ – How to write the queries - part 2
In this post I'll focus on the query options in DLINQ. Let's take two simple scenarios: 1. Retrieve all the employees with the letter "a" in their first name. 2. Retrieve all employees in the "R&D" department There are three common ways to write these queries in DLINQ: 1. Using SQL syntax: The most simple (or maybe intuitive) way to write a standard query statement is by using the SQL syntax. For example, for the first scenario we should write a code like this: IEnumerable < Employee >...

Posted Thursday, August 09, 2007 1:33 AM by Avi Wortzel | with no comments

Introducing to DLINQ - Entities declaration - part 1
One of the major parts in LINQ project is DLINQ – .Net L anguage In tegrated Q uery for relational D ata. DLINQ is a smart data access layer framework (component of the ADO.NET family), with an advanced runtime infrastructure and design time tools for managing data (queries and data manipulations) from a relational db as an object. The usage of this framework is very easy: The basic class in DLINQ is call "Entity class", each class represent a single database table. The properties in this class will...

Posted Thursday, August 02, 2007 11:16 AM by Avi Wortzel | with no comments