initialize the datacontext with a different connectionstring

initialize the datacontext with a different connectionstring

Postby infinitep » Sun 18 Apr 2010 08:47

How do I initialize the datacontext with a different connectionstring for Linq to MySQL?

If i pass a connectionstring to initialize the context it doesnt seem to work if the database name is different to the one the context was created with.

Thanks.
infinitep
 
Posts: 17
Joined: Wed 08 Jul 2009 16:31

Postby infinitep » Mon 19 Apr 2010 09:51

I can live without this feature, the multiple selection (all in one properties editing) in the Entity Developer is more important than this. Part my bad on changing the development database to do a table comparission. Will restore the other way around for future compares.
infinitep
 
Posts: 17
Joined: Wed 08 Jul 2009 16:31

Postby AndreyR » Mon 19 Apr 2010 14:29

There is a solution for the problem.
You should change the code generation template in the following way:
Replace the
Code: Select all
[Table(Name = @"<#= codeProvider.GetQuotedString(cls.Source) #>")]

line with this one:
Code: Select all
[Table(Name = @"<#= codeProvider.GetQuotedString(cls.Source.Remove(0, cls.Source.IndexOf(".") + 1)) #>")]
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for MySQL