Devart.Data.SQLite.Linq + Devart.Data.Linq namespaces

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
shaharw18
Posts: 43
Joined: Thu 20 Oct 2011 20:07

Devart.Data.SQLite.Linq + Devart.Data.Linq namespaces

Post by shaharw18 » Thu 20 Oct 2011 20:32

hi.

I've using visual studio express 2010 with c#.
I've installed Entity Developer and LinqConnect.
with both I've managed to define a class to my Sqlite database.

I've exported the DataContext1.Designer.cs to my app_code folder.
and managed to write the following code:

Db.MainDataContext ent = new Db.MainDataContext();
var subjects = from s in ent.Subjects where s.fid == 0 select s;

th DB namespace has been created by the Entity Developer.
all was good, till I've tried to run my project.
and then, I got errors, exists in the DataContext1.Designer.cs itself.

in different locations inside the file there is a: Devart.Data.Linq.DataContext
Devart.Data.SQLite.Linq

namespaces that visual studio does not recognize.
there are no bugs in my code but inside the auto-generated code that was created.
I've placed all necessary DLLs inside my BIN folder.

what else should I do?

thanks in advanced.
Shahar.

shaharw18
Posts: 43
Joined: Thu 20 Oct 2011 20:07

some extra info

Post by shaharw18 » Thu 20 Oct 2011 20:59

here's the error list I'm getting:

Warning 1 Unreachable code detected d:\WWWROOT\yuvalDayan\backoffice\Subjects.aspx.cs 29 13 d:\WWWROOT\yuvalDayan\
Error 2 The type or namespace name 'Linq' does not exist in the namespace 'Devart.Data.SQLite' (are you missing an assembly reference?) d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 25 50 d:\WWWROOT\yuvalDayan\
Error 3 The type or namespace name 'Linq' does not exist in the namespace 'Devart.Data' (are you missing an assembly reference?) d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 26 56 d:\WWWROOT\yuvalDayan\
Error 4 The type or namespace name 'Linq' does not exist in the namespace 'Devart.Data' (are you missing an assembly reference?) d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 28 35 d:\WWWROOT\yuvalDayan\
Error 5 The type or namespace name 'Linq' does not exist in the namespace 'Devart.Data' (are you missing an assembly reference?) d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 28 92 d:\WWWROOT\yuvalDayan\
Error 6 The type or namespace name 'Linq' does not exist in the namespace 'Devart.Data' (are you missing an assembly reference?) d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 29 95 d:\WWWROOT\yuvalDayan\
Error 7 The type or namespace name 'Linq' does not exist in the namespace 'Devart.Data' (are you missing an assembly reference?) d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 34 48 d:\WWWROOT\yuvalDayan\
Error 8 'object' does not contain a constructor that takes 2 arguments d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 43 9 d:\WWWROOT\yuvalDayan\
Error 9 'object' does not contain a constructor that takes 2 arguments d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 49 9 d:\WWWROOT\yuvalDayan\
Error 10 'object' does not contain a constructor that takes 2 arguments d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 55 13 d:\WWWROOT\yuvalDayan\
Error 11 'object' does not contain a constructor that takes 2 arguments d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 61 13 d:\WWWROOT\yuvalDayan\
Error 12 'object' does not contain a constructor that takes 2 arguments d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 67 13 d:\WWWROOT\yuvalDayan\
Error 13 'object' does not contain a constructor that takes 2 arguments d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 73 13 d:\WWWROOT\yuvalDayan\
Error 14 The type or namespace name 'Linq' does not exist in the namespace 'Devart.Data' (are you missing an assembly reference?) d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 78 28 d:\WWWROOT\yuvalDayan\
Error 15 'Db.MainDataContext' does not contain a definition for 'GetTable' and no extension method 'GetTable' accepting a first argument of type 'Db.MainDataContext' could be found (are you missing a using directive or an assembly reference?) d:\WWWROOT\yuvalDayan\App_Code\DataContext1.Designer.cs 82 29 d:\WWWROOT\yuvalDayan\


and here's the DataContext1.Designer.cs file itself:


//------------------------------------------------------------------------------
// This is auto-generated code.
//------------------------------------------------------------------------------
// This code was generated by Entity Developer tool using LinqConnect template.
// Code is generated on: 20/10/2011 23:02:53
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//------------------------------------------------------------------------------

using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data;
using System.ComponentModel;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;

namespace Db
{

[System.Data.Linq.Mapping.DatabaseAttribute(Name = "main")]
[ProviderAttribute(typeof(Devart.Data.SQLite.Linq.Provider.SQLiteDataProvider))]
public partial class MainDataContext : Devart.Data.Linq.DataContext
{
public static Devart.Data.Linq.CompiledQueryCache compiledQueryCache = Devart.Data.Linq.CompiledQueryCache.RegisterDataContext(typeof(MainDataContext));
private static System.Data.Linq.Mapping.MappingSource mappingSource = new Devart.Data.Linq.Mapping.AttributeMappingSource();

#region Extensibility Method Definitions

partial void OnCreated();
partial void OnSubmitError(Devart.Data.Linq.SubmitErrorEventArgs args);

partial void InsertSubject(Subject instance);
partial void UpdateSubject(Subject instance);
partial void DeleteSubject(Subject instance);

#endregion

public MainDataContext() :
base(@"Data Source=D:\WWWROOT\yuvalDayan\App_Data\db.db", mappingSource)
{
OnCreated();
}

public MainDataContext(System.Data.Linq.Mapping.MappingSource mappingSource) :
base(@"Data Source=D:\WWWROOT\yuvalDayan\App_Data\db.db", mappingSource)
{
OnCreated();
}

public MainDataContext(string connection) :
base(connection, mappingSource)
{
OnCreated();
}

public MainDataContext(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}

public MainDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}

public MainDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}

public Devart.Data.Linq.Table Subjects
{
get
{
return this.GetTable();
}
}
}


///
/// There are no comments for Subject in the schema.
///
[Table(Name = @"""main"".subjects")]
public partial class Subject : INotifyPropertyChanging, INotifyPropertyChanged
{

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

private int _Id;

private string _Title;

private System.Nullable _Fid;

#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnIdChanging(int value);
partial void OnIdChanged();
partial void OnTitleChanging(string value);
partial void OnTitleChanged();
partial void OnFidChanging(System.Nullable value);
partial void OnFidChanged();
#endregion

public Subject()
{
OnCreated();
}


///
/// There are no comments for Id in the schema.
///
[Column(Name = @"id", Storage = "_Id", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "INTEGER NOT NULL", IsDbGenerated = true, IsPrimaryKey = true)]
public int Id
{
get
{
return this._Id;
}
set
{
if (this._Id != value)
{
this.OnIdChanging(value);
this.SendPropertyChanging();
this._Id = value;
this.SendPropertyChanged("Id");
this.OnIdChanged();
}
}
}


///
/// There are no comments for Title in the schema.
///
[Column(Name = @"title", Storage = "_Title", DbType = "VARCHAR")]
public string Title
{
get
{
return this._Title;
}
set
{
if (this._Title != value)
{
this.OnTitleChanging(value);
this.SendPropertyChanging();
this._Title = value;
this.SendPropertyChanged("Title");
this.OnTitleChanged();
}
}
}


///
/// There are no comments for Fid in the schema.
///
[Column(Name = @"fid", Storage = "_Fid", DbType = "INTEGER")]
public System.Nullable Fid
{
get
{
return this._Fid;
}
set
{
if (this._Fid != value)
{
this.OnFidChanging(value);
this.SendPropertyChanging();
this._Fid = value;
this.SendPropertyChanged("Fid");
this.OnFidChanged();
}
}
}

public event PropertyChangingEventHandler PropertyChanging;

public event PropertyChangedEventHandler PropertyChanged;

protected virtual void SendPropertyChanging()
{
if (this.PropertyChanging != null)
this.PropertyChanging(this, emptyChangingEventArgs);
}

protected virtual void SendPropertyChanging(System.String propertyName)
{
if (this.PropertyChanging != null)
this.PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
}

protected virtual void SendPropertyChanged(System.String propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}

shaharw18
Posts: 43
Joined: Thu 20 Oct 2011 20:07

HERE IS THE SOLUTION

Post by shaharw18 » Thu 20 Oct 2011 22:10

Hi to everybody,

I found the solution.
there were two files missing in the project's BIN folder.
I found them inside the programs files\DevArt folder.

and that solved my case.

thank you fo everything !

Shahar

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 21 Oct 2011 08:53

Glad to see that the problem was resolved. Generally, it is necessary to place the provider (Devart.Data and, e.g., Devart.Data.SQLite) and LinqConnect (Devart.Data.Linq and Devart.Data.SQLite.Linq) runtime assemblies into the bin folder of your application when deploying it.

Feel free to contact us if you have any questions or encounter any problems when using LinqConnect.

Post Reply