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 8121865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:38:28+00:00 2026-06-06T05:38:28+00:00

I am learning with this so bear with me…I am trying to create the

  • 0

I am learning with this so bear with me…I am trying to create the DB object to access the table.

AppDatabaseDataContext appDb = new AppDatabaseDataContext();

This gives me an error, so I create the constructor…

public AppDatabaseDataContext()
{

} 

Now this tells me that System.Data.Linq.DataContext does not contain a constructor that takes 0 parameters. Why?

Thanks!

  • 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-06T05:38:31+00:00Added an answer on June 6, 2026 at 5:38 am

    You need to specify a connection string. If you know it’s always going to be the same (for example, localhost) you can just hard-code it in your parameterless constructor:

    public AppDatabaseDataContext()
        : this(@"Data Source=localhost;Initial Catalog=Foo;Integrated Security=True")
    {
    }
    

    Notice how we chain the constructor to call the version that consumes a connection string. This way, you can instantiate the data context using the parameterless constructor, and it will use this default connection string.

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

Sidebar

Related Questions

I'm new to programming so bear with me, this is a big learning experience
Just learning this stuff, so bear with any ignorance... In what I'm trying to
I'm a bit new at this so bear with me. I'm currently learning C#
I am still learning PHP, so bear with me. I am trying to create
What exactly is OData and how important/necessary is it to start learning this new
I am new to network programming, and have been learning this by writing small
I'm coming from C# and very new at this so please bear with me.
This is a totally newbie question, so please bear with me. I am learning
First of all, I am new here and just learning sql, so bear with
Hello I am new to codeigniter. I am learning this framework by developing a

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.