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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:16:39+00:00 2026-05-30T10:16:39+00:00

I don’t get why is that the dbo in this query var searchUser =

  • 0

I don’t get why is that the “dbo” in this query

var searchUser = from user in dbo.Accounts
                             where user.accnt_user == txtUser.Text &&
                             user.accnt_pass == txtPassword.Text
                             select user;

Shows this error

“The name ‘dbo’ does not exist in the current context”

but when I remove the word “dbo” it shows me this error

The Name Accounts does not exist in the current context.

Here’s my Table enter image description here

and inside my DataClasssesContext I have this

[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Accounts")]
    public partial class Account : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private int _accnt_ID;

        private string _accnt_User;

        private string _accnt_Pass;

        private string _accnt_Position;

    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void Onaccnt_IDChanging(int value);
    partial void Onaccnt_IDChanged();
    partial void Onaccnt_UserChanging(string value);
    partial void Onaccnt_UserChanged();
    partial void Onaccnt_PassChanging(string value);
    partial void Onaccnt_PassChanged();
    partial void Onaccnt_PositionChanging(string value);
    partial void Onaccnt_PositionChanged();
    #endregion

        public Account()
        {
            OnCreated();
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_accnt_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
        public int accnt_ID
        {
            get
            {
                return this._accnt_ID;
            }
            set
            {
                if ((this._accnt_ID != value))
                {
                    this.Onaccnt_IDChanging(value);
                    this.SendPropertyChanging();
                    this._accnt_ID = value;
                    this.SendPropertyChanged("accnt_ID");
                    this.Onaccnt_IDChanged();
                }
            }
        }

I did not post all of my code in the datacontext because it is long.

  • 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-05-30T10:16:40+00:00Added an answer on May 30, 2026 at 10:16 am

    That error is telling you precisely what you need to know, that the name dbo does not exist. There is no variable, field, or static class that exists that is accessible at that line of code, and therefore the compiler is telling you that the name does not exist in the present context.

    For example, given this class and method definition

    class Foo
    {
        public void Frob()
        {
            Console.WriteLine(bar); // bar does not exist!
        }
    }
    

    bar refers to neither a local variable or class field, and will result in the same error you observed.

    Regarding your specific code, your comment to the question indicates you have an instance of a DataClasses1DataContext class. This is more than likely what you need to use in your query.

    using (var myDbContext = new DataClasses1DataContext())
    {
        var query = from user in myDbContext.Accounts
                    where user.Blah == whatever
                    select user;
    
         // use query results
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't understand where the extra bits are coming from in this article about
For some reason, after submitting a string like this Jack’s Spindle from a text
Don't know if there is a better way to do this, so that is
Don't dismiss this as a newbie question! It's not, I'm not, I've tried everything,
Don't know how to google for such, but is there a way to query
I don't know when to add to a dataset a tableadapter or a query
(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't know if this has been asked before, so point me to another question
Don't know how to explain it better but i'm trying to get a response
Don't think that I'm mad, I understand how php works! That being said. I

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.