none
Problem adding local database in Visual C# 2010 Express RRS feed

  • Question

  • Hello, I am new to this forum and to the world of programming in general. I don't know if I'm posting in the right section, but I hope I am.

    I considered the book "Head First C#" to be a good starting point. Right in the beginning, I am told to create a database. Right now, I don't know exactly what is a database or how to use it, but I am following the book with the hope that I'll understand all of these someday.

    So, my problem is that when I try to add a "local database" to my project using the Solution Explorer, (Add - New Item) I name it "something.sdf" and after clicking "Add" I 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 associated with the file will not be generated."

    This appears with a yellow warning sign. Afterwards, the something.sdf file gets added to the Solution Explorer, but when I double-click on it I get the following error:

    "The operation could not be completed. Unspecified error".

    I am using Microsoft Visual C# 2010 Express SP1 on Windows 7 64-bit and I have the following installed on my computer:

    http://imgbox.com/g/NjdcO0kC66

    Thanks in advance!


    Thursday, October 18, 2012 8:30 PM

All replies

  • Can you give some more specifics regarding exactly what you're selecting when you're setting the database up? 

    For instance, after selecting the .sdf option, are you presented with a window asking, "Choose a Database Model" at the top? If so, can you walk through what you are doing there?

    Another option could be to add a database into your local instance of MS SQL Server and create a connection to that, rather than creating the .sdf. 

    Do you have SQL Server Management Studio Express installed? If not, go here:

    http://www.microsoft.com/en-us/download/details.aspx?id=8961

    You should have a default instance of SQL Server installed on your machine which you can connect to using the Management Studio. The samples in your book would still be the same, but you'd simply be using your local machine's database.)

    Friday, October 19, 2012 1:50 AM
  • Friday, October 19, 2012 3:01 AM
  • Thanks for you replies!

    @Nate Greenwood

    These are the steps I am following:

    In my project (Windows Forms Application), I go to the Solution Explorer, right-click on "WindowsFormsApplication1" (new project, didn't put a name), then "Add" - "New Item". I select local database, then just the "Add" button.

    http://imgbox.com/addtkGKL

    Then I get the error presented on my first post.

    I installed SQL Server Management Studio Express, but I don't know how to use it (as mentioned in my first post, I am new to programming).

    @chanmm

    After I get to "Modify Connection" - "Advanced Properties", for Data Source I can select only .\SQLEXPRESS, I don't have the (LocalDB) option, but anyway I thought it is supposed to be .\SQLEXPRESS.

    Friday, October 19, 2012 9:03 AM
  • Still looking for help.
    Saturday, October 20, 2012 6:34 PM