cannot use dbMetal with MySQL (HELP)

259 views
Skip to first unread message

Mohammed BENJELLOUN

unread,
May 19, 2012, 6:48:17 AM5/19/12
to DbLinq
Hello,

I'm trying to use Linq 2 with mysql in console application with v4
of .net framework,

I successfully generate .cs and .dbml files and copy them in my
project (with DbMetal.exe.config file). I already add references
(dblinq, dblinq.mysql,dblinq.sqlserver,mysql.data,system.data.linq).

I think that's all i need to do ?

now when i compil my project i have somme errors :


Error 2 Cannot implicitly convert type
'DbLinq.Data.Linq.Table<ConsoleApplication2.Client>' to
'System.Data.Linq.Table<ConsoleApplication2.Client>' c:\users
\benjelloun\documents\visual studio 2010\Projects
\ConsoleApplication2\ConsoleApplication2\file.designer.cs 73 12
ConsoleApplication2

and :


Error 1 'MySql' is a 'namespace' but is used like a 'type' c:\users
\benjelloun\documents\visual studio 2010\Projects
\ConsoleApplication2\ConsoleApplication2\file.designer.cs 26 61
ConsoleApplication2

here :
[global::System.Data.Linq.Mapping.ProviderAttribute(typeof(MySql))]

To resolve this problems i comment the first and for the second i
change it to :

[global::System.Data.Linq.Mapping.ProviderAttribute(typeof(DbLinq.MySql.MySqlSqlProvider))]

The problem now is when i exetute the application, it cannot
initialize the database connection in DataContext file :

public MFPMonitorDbServer(string connectionString) :
base(connectionString)
{
this.OnCreated();
}

and i have this error (no source available) :

The file 'z:\Development\DbLinq-0.20.1\src\DbLinq\Data\Linq
\DataContext.cs' does not exist.

and i don't have this path in my computer

NOTE :
i have the same problem if i use .cs file allone (without .dbml file)

Please help me ??

Mohammed BENJELLOUN

unread,
May 19, 2012, 6:48:18 AM5/19/12
to DbLinq
Message has been deleted

dev...@gmail.com

unread,
Aug 5, 2012, 6:16:57 AM8/5/12
to dbl...@googlegroups.com
I had the same issue. The .dbml file had not been connected to .cs file. After we add the .dbml file, VS automatically generates a corresponding cs file which is different from the cs file generated by DbMetal.

solution:
1- add the .dbml file
2- add the .cs file (choose over write the existing cs file)

worked for me.
Reply all
Reply to author
Forward
0 new messages