How to generate dbml file

Posts   
 
    
jbliss1234
User
Posts: 42
Joined: 04-May-2007
# Posted on: 14-Dec-2010 23:05:55   

I would like to use LLBLGen to generate a linq to sql dbml file as the code generated by LLBLgen is not working corectly with Dynamic Data. In the Global.asax, I have this code:



MetaModel model = new MetaModel();

            model.RegisterContext(typeof(SmartUR.Model.SmartURDataContext), 
                    new ContextConfiguration()
                    {
                        ScaffoldAllTables = true                        
                    });  

which throws an exception:


InvalidOperationException: Sequence contains no matching element

If I use the generic MSFT Linq to sql file, it works fine, but I absolutely hate their designer. Please help!!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Dec-2010 04:31:56   

LLBLGen already has DynamicData support. You can download the support files and instructions at LLBLGen site (Customer Area) -> v2.6 Downloads -> Extras. If you are using LLBLGen v3, read this to make it work.

On the other hand, if you want to generate Linq2Sql dbml file, you can in v3. Create a new project and select Linq2Sql as the target framework.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 15-Dec-2010 11:06:32   

(you didn't mention a version, so I assume v3) V3 emits 2 types of mappings: a .xml file (which is equal to the .dbml file generated by MS' designer) and attribute based mappings (so no file is emitted).

For dynamic data, this doesn't matter, it works with a context. So in whatever format your mappings are stored (xml file, attributes), if the context reads them and works properly, dynamic data will too.

So 1) get the latest build to see whether we have fixed an issue with linq to sql which might cause this 2) try either attribute based mapping or xml mappings (through the settings)

Frans Bouma | Lead developer LLBLGen Pro