tags:

views:

120

answers:

4

Good Afternoon,
I am looking to add a local database file (.sdf) into my .Net Project, so i go right click on my project, click "Add" -> "New Item", select "Local Database" and rename it to what i want. I then click the "Add" button and get the following error
"The data provider required to connect to the local data file could not be found. The file will be added to the project but the typed DataSet assosciated with the file will not be generated."

I am using Visual Studio 2008 .Net Framework 3.5

Could anyone please advise as to why this is happening?

Thanks

+1  A: 

You might be missing the SqlCompact 3.5sp1 install or possibly the SqlCompact tools for visual studio. Try installing or reinstalling those.

http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en

sadboy
or do add remove programs and modify the visual studio install to make sure it's there.
sadboy
Hi @sadboy, i have both of this installed. Cheers
Ben
ahh, you might try reinstalling them anyway. Sometimes because of the order or whatever visual studio gets out of whack. There is a similar thread where this was the fix.the 2nd to last post in this thread.http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/a6f15bda-4e36-4362-bc02-93b9fb26cdcd
sadboy
A: 

An sdf file is for SQL Server 2005 Compact Edition or SQL Server 2005 Mobile Edition do you have either of these already installed on your machine?

If your after just a normal database it the mdf file list as "SQL Server database" in VS2008.

Simon G
+1  A: 

Have you tried adding a reference to the SQL Server CE assembly before adding the file? you shouldn't need to, but you might have a conflict somewhere.

For me, I automatically get a reference to C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Desktop\System.Data.SqlServerCe.dll

Also, it's worth checking that you have the "Microsoft SQL Server Compact 3.5 SPx Design Tools English" installed, (where SPx is the service pack version, and the English is your preferred language)

Rowland Shaw
A: 

Hi all, I ran a repair on Visial Studio and it seems to have fixed the problem.

Ben