1. Retrieving Data in Model Explorer does not work.
---------------------------
Microsoft Visual Studio 2012
---------------------------
Could not load file or assembly 'Devart.Data.Linq' or one of its dependencies. The system cannot find the file specified.
---------------------------
OK
---------------------------
2. If you have 2 entity with FK, you cant get data from child table.
METRO PROBLEMS
Re: METRO PROBLEMS
The possible cause of the error with retrieving Data in Model Explorer is that something was wrong with the integration into Visual Studio while installing LinqConnect for Metro.
Please make sure that:
- LinqConnect for Metro was integrated into Visual Studio during the installation (the option "Visual Studio integration" should have been selected);
- the assembly Devart.Data.Linq is available in the GAC;
If not - please re-install LinqConnect (with the option "Visual Studio integration" selected). Also, please specify whether you have disabled any other options during the installation of LinqConnect for Metro?
As for the several entities with FK, could you please send us a sample project so that we able to reproduce and investigate this issue in more details.
Please make sure that:
- LinqConnect for Metro was integrated into Visual Studio during the installation (the option "Visual Studio integration" should have been selected);
- the assembly Devart.Data.Linq is available in the GAC;
If not - please re-install LinqConnect (with the option "Visual Studio integration" selected). Also, please specify whether you have disabled any other options during the installation of LinqConnect for Metro?
As for the several entities with FK, could you please send us a sample project so that we able to reproduce and investigate this issue in more details.
Re: METRO PROBLEMS
1. I have reinstalled LinqConnect. Also I have manually installed to GAC(Devart.Data.dll; Devart.Data.Linq.dll; Devart.Data.SQLite.dll; Devart.Data.SQLite.Linq.dll) and got strange error.
Also I have used that code:
Is this correct to use something like that to access child table "g.IMG.FILENAME" where g is main table and "IMG" is child table?
UPD: It fixed after third reinstallation.
3. Script generation also is incorrect. When click on "Generate Database from Model", script is correct(it create database with FK option), but when I @db.CreateDatabase(false, true); database is creating without FK option.
2. About second point. I cant place whole project, but I can place http://sdrv.ms/RD3SDC. I have uploaded simple database model.The result of model generation or query syntax is not valid.
Failed to compile and load the working library with the model.
Error List:
error1 : The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
error2 : The type 'System.IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
error3 : The type 'System.ComponentModel.INotifyPropertyChanging' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Devart.Data.Linq\v4.0_4.0.45.1__09af7300eec23701\Devart.Data.Linq.dll'
error4 : The type 'System.ComponentModel.INotifyPropertyChanging' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Devart.Data.Linq\v4.0_4.0.45.1__09af7300eec23701\Devart.Data.Linq.dll'
error5 : The type 'System.ComponentModel.PropertyChangingEventArgs' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Devart.Data.Linq\v4.0_4.0.45.1__09af7300eec23701\Devart.Data.Linq.dll'
error6 : The type 'System.ComponentModel.PropertyChangingEventHandler' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Devart.Data.Linq\v4.0_4.0.45.1__09af7300eec23701\Devart.Data.Linq.dll'
error7 : The type 'System.ComponentModel.PropertyChangingEventArgs' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Devart.Data.Linq\v4.0_4.0.45.1__09af7300eec23701\Devart.Data.Linq.dll'
error8 : The type 'System.ComponentModel.PropertyChangingEventHandler' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Devart.Data.Linq\v4.0_4.0.45.1__09af7300eec23701\Devart.Data.Linq.dll'
error9 : The type 'System.Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
error10 : 'Devart.Data.Linq.Mapping.DatabaseAttribute' is not an attribute class
error11 : 'Devart.Data.Linq.Mapping.ProviderAttribute' is not an attribute class
error12 : 'Devart.Data.Linq.Mapping.ColumnAttribute' is not an attribute class
error13 : 'Devart.Data.Linq.Mapping.ColumnAttribute' is not an attribute class
error14 : 'Devart.Data.Linq.Mapping.ColumnAttribute' is not an attribute class
error15 : 'Devart.Data.Linq.Mapping.AssociationAttribute' is not an attribute class
error16 : 'Devart.Data.Linq.Table' is not an attribute class
error17 : 'Devart.Data.Linq.Mapping.TableAttribute' is not an attribute class
error18 : 'Devart.Data.Linq.Mapping.ColumnAttribute' is not an attribute class
error19 : 'Devart.Data.Linq.Mapping.ColumnAttribute' is not an attribute class
error20 : 'Devart.Data.Linq.Mapping.ColumnAttribute' is not an attribute class
error21 : 'Devart.Data.Linq.Mapping.ColumnAttribute' is not an attribute class
error22 : 'Devart.Data.Linq.Mapping.ColumnAttribute' is not an attribute class
error23 : 'Devart.Data.Linq.Mapping.AssociationAttribute' is not an attribute class
error24 : 'Devart.Data.Linq.Table' is not an attribute class
error25 : 'Devart.Data.Linq.Mapping.TableAttribute' is not an attribute class
Also I have used that code:
Code: Select all
foreach (var g in DataModel.DataBaseSQ.db.TitleGroups)
{
in that place I use code that look like
g.KEY, g.NAME, g.NAME, g.IMG.SOURCE, g.IMG.FILENAME, g.DESCRIPTION
}
UPD: It fixed after third reinstallation.
3. Script generation also is incorrect. When click on "Generate Database from Model", script is correct(it create database with FK option), but when I @db.CreateDatabase(false, true); database is creating without FK option.
Re: METRO PROBLEMS
1) Most likely you've added the wrong assembly into the GAC. The installation has two assemblies Devart.Data.Linq.dll: one of them is used for integration with Visual Studio, and the other - for referencing in the Metro project. The first one must be added to the GAC. Please try removing the "Devart.Data.Linq.dll" from the GAC.
2) We recommend you to use the eager loading to access the dependent records in such scenarios, because otherwise in your case a query for each of the table records would be performed instead of a single query.
For example, you can modify your code in the following way:
3) We cannot reproduce this issue. We get the following SQL script when performing CreateDatabase(false, true):
Please send us the SQL script you get. To get it use the Log property (http://www.devart.com/linqconnect/docs/Logging.html).
2) We recommend you to use the eager loading to access the dependent records in such scenarios, because otherwise in your case a query for each of the table records would be performed instead of a single query.
For example, you can modify your code in the following way:
Code: Select all
YourDataContext db = new YourDataContext();
var load = db.TitleGroups.LoadWith(o => o.IMG);
var query = from c in load where c.ID==1 select c;
foreach(var g in query)
{
// add code here
}
Code: Select all
CREATE TABLE TITLEGROUPS (
ID INT NOT NULL,
GROUP_KEY TEXT NOT NULL,
TITLE TEXT NOT NULL,
DESCRIPTION TEXT NOT NULL,
IMG_ID INT,
CONSTRAINT PK_TITLEGROUPS PRIMARY KEY (ID),
CONSTRAINT FK_TITLEGROUPS_IMGS_0 FOREIGN KEY (IMG_ID) REFERENCES IMGS (ID)
)