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 
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.
That error is telling you precisely what you need to know, that the name
dbodoes 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
barrefers 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
DataClasses1DataContextclass. This is more than likely what you need to use in your query.