views:

94

answers:

4

I have a Windows application written in C# that works with an Access database file. Furthermore, I use some DataSets in my project that work with this Access database.

Arising from this, I have two questions:

  1. How can I convert the Access database file into an SQL Server database, and
  2. How can I convert the project code (using Access DataSets) to work with the SQL Server database?
+3  A: 

I believe that MS-Access has an "export to SQL" functionality somewhere. simple google reveals details here and here

Muad'Dib
And DataSet in My C# Project?
hosseinsinohe
You could do that, if you want to do it the hard way. Why re-invent the wheel?
Muad'Dib
I will a way to Convert Automatically?
hosseinsinohe
+1  A: 

Have you tried using the inbuilt upsizing wizard in MS Access? Under Access 2007 its under the Database Tools tab | SQL Server.

From the description: "The Upsizing wizard allows you to easily upsize your Microsoft Access Database to a Microsoft SQL server database"

RandomNoob
The upsizing wizard is OK, but you usually end up behind the times, as A2007 came out before SQL Server 2008, so it doesn't work as well with 2008 as it does with 2005 and before. The SSMA is really the best way to go (see @madatanic's answer above) in most cases.
David-W-Fenton
+2  A: 

Try SQL Server Migration Assistant for Access from the link below.

http://www.microsoft.com/downloads/details.aspx?FamilyID=d842f8b4-c914-4ac7-b2f3-d25fff4e24fb&displaylang=en

and for SQL Server Migration Assistant 2008 for Access

http://www.microsoft.com/downloads/details.aspx?FamilyID=133b59c2-c89c-4641-bebb-6d04476ec1ba&DisplayLang=en

madatanic
+2  A: 

you can import database from access db to sql server. for this you can make a new db in sql server, then press right click in db name, after that from showed menu, go like below:

Tasks->Import Data

use Microsoft Access as data source. this is the best way.

masoud ramezani