Acess VBA code conversion to C# using LINQ to SQL

Joined
12/16/07
Messages
29
Points
11
Hey guys,

I have a project which requires me to change some Access VBA code into C# code using LINQ to SQL. Does anyone have any suggestions on how to proceed on this?? Does Microsoft Visual Studio 2008 or 2005 have any functions like that ??

Your comments are much appreciated :tiphat:
 
Make sure you have .NET 3.5 for the latest libraries that supports LINQ. Using LINQ-SQL in C# is a blast. I use VS2008 so I don't know how VS2005 is wrt LINQ
Here is some example code
Code:
using System;
using System.Linq;
using System.Data.Linq;
using nwind;
Northwind db = new Northwind(@"Data Source=.\SQLEXPRESS;Initial Catalog=Northwind");

var custs =
  from c in db.Customers
  where c.City == "Rio de Janeiro"
  select c;
foreach (var cust in custs)
  Console.WriteLine("{0}", cust.CompanyName);

The tasks that you have to do now is to get a connection string that will connect to your SQL server from the Access/VBA string.
 
Back
Top Bottom