0

I'm used to work with ASP.NET and I have no problems there, but now I need to create a C# Console application and something is wrong.

  • I create console application
  • Add new item to project (Local database)
  • Fill in some basic data (id, name)

But when I create LINQ to SQL Class and drag my table to it like I do in ASP.NET I get error

The selected objects use an unsupported data provider

What am I doing wrong here, how can I make my work with databases using C# Console/Windows application as fast and easy as with ASP.NET applications?

1
  • 3
    How are you connecting to your database? Where is your connection string defined? Visual Studio will create a web.config file for ASP.NET applications. You will need to add an app.config file or hard code the connection string someplace. Commented Jan 6, 2012 at 17:36

2 Answers 2

2

The database driver / provider needs to allow for the usage of linq. If you are using a simple sqlite db, I would recommend using the DBLinq provider.

If you are using Microsoft's lightweight database (Sql Compact) then I believe this article maybe helpful.

Sign up to request clarification or add additional context in comments.

2 Comments

Is the SqlMetal goes by default with Visual Studio 2010 installation and I won't have problems using it on different computer that has same compiler installed as me?
I believe sqlmetal is part of the windows sdk ... I think it gets installed by default with VS 2010. If it's missing you can download the sdk here (msdn.microsoft.com/en-us/windows/bb980924.aspx) or add the feature with the VS2010 installer.
0

The Object Relational Designer (O/R Designer) supports only the .NET Framework Data Provider for SQL Server ( System.Data.SqlClient).

Where as sdf local DB is a Compact Database. SQL Server Compact Edition (System.Data.SqlServerCe) is not supported by O/R Designer.

Instead you can create a db in SQLExpress and connect to Designer

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.