Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7763707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:43:36+00:00 2026-06-01T14:43:36+00:00

I seem to be missing a step in setting up my database in Visual

  • 0

I seem to be missing a step in setting up my database in Visual Studio. I created a .mdf database titled “PhotoDatabase”. In the server explorer I added a new table called “tbl_Photo” which has the following columns: Image_ID, Image, Thumbnail, Name, Description.

Right now I am in my PhotoRepository(.cs) class and am trying to add the image data to my table but it just can’t seem to find the table.

DataContext db = new DataContext(@"C:\Dev\MyFlickr\MyFlickr.WCF\App_Data\PhotoDatabase.mdf");
db.

Everywhere I looked said I should be able to see my table name after the db. Help Please!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:43:37+00:00Added an answer on June 1, 2026 at 2:43 pm

    I think I have found your problem. It looks like you have not created a dbml file to map your tables to entities. What you need to do is add a new item to your project. Under the “Data” subsection, you will see “LINQ to SQL Classes”. Add that and then drag your table onto that class from your Server Explorer window. After that, you should be able to see your table as an entity and the above code should work (or code close to it). For instance, I created a file like you have and the following code works:

    DataContext db = new DataContext(@"C:\Temp\Test.mdf");
    Table<Table1> myTable = db.GetTable<Table1>();
    

    In order for it to work, though, I had to create that dbml file and add Table1 to the designer. For more information on how to use this code, you can look at this MSDN article: http://msdn.microsoft.com/en-us/library/bb399375.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really new to SVN and seem to be missing something here... I have
I seem to be missing something obvious here, why would I want more than
Maybe I'm just missing something in the docs, but it seem it's not possible
I can't seem to run a build execute shell step in Jenkins. I've worked
I seem to be missing some key concept(s) when it comes to flex itemrenderers,
I seem to be missing something silly here. int main() { /* bitset<sizeof(int)*8> bisetInt(64);
In Visual Studio 2003, I am trying to set an environment variable in the
Maybe I just missing the forest for the trees again, but I can't seem
So I'm messing around with asp.net and I seem to be stuck on a
I'm messing around with jQuery and ran in to a problem I can't seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.