Help in DbLinq for SQLite

168 views
Skip to first unread message

NowOrNever

unread,
Jun 10, 2012, 6:50:22 AM6/10/12
to dbl...@googlegroups.com
It has been 2 months since i struggled to marry LINQ with SQLite using DBLinq 

I've generated the .dbml and the .cs files and added the following references :

DbLinq.dll
DbLinq.Sqlite.dll
SQLite.NET.dll
System.Data.SQLite.dll

but what i get from code is strange,

  Main da = new Main(DALite.Properties.Settings.Default.SHSLiteConnectionString);

  da.Customer is of type "DbLinq.Data.Linq.Table<Customer>" but i want it to be of the type "Customer" from the .dbml file.
 
 I can see the class in the .dbml file like 

 public partial class  Customer  : System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

 So, why its not giving me this object when am trying with the accessor da.Customer?

Please help, am really frustrated here,


Carl

unread,
Apr 12, 2013, 10:20:41 AM4/12/13
to dbl...@googlegroups.com
You are declaring your object from with the context when a class of the same name should also live outside of your context, probably in the same namespace as your data context.

This class will allow you to decalre a single Customer object.

On writing this I realise that the post is nearly a year old now but this may be helpful to somebody else! I personally renamed my entity set objects within the context class to the plural to avoid confusion, LINQ to SQL does this automatically I believe.
Reply all
Reply to author
Forward
0 new messages