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.

On Saturday, May 19, 2012 3:48:17 AM UTC-7, Mohammed BENJELLOUN wrote:
>
> 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 ??

-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/dblinq/-/FNPToR9rIxUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to