Search Results

Search found 14 results on 1 pages for 'dblinq'.

Page 1/1 | 1 

  • DBLinq not generating where clause

    - by sipwiz
    I'm testing out DBLinq-0.18 and DBLinq from SVN Trunk with MySQL and Postgresql. I'm only using a very simple query but on both database DBLinq is not generating a Where clause. I have confirmed this by turning on statement logging on Postgresql to check exactly what request DBLinq is sending. My Linq query is: MyDB db = new MyDB(new NpgsqlConnection("Database=database;Host=localhost;User Id=postgres;Password=password")); var customers = from customer in db.Customers where customer.CustomerUserName == "test" select customer; The query works ok but the SQL generated by DBLinq is of the form: select customerusername, customerpassword .... from public.customers There is no Where clause which means DBLinq must be pulling the whole table down before running the Linq query. Has anyone had any experience with DBLinq and know what I could be doing wrong?

    Read the article

  • creating Linq to sqlite dbml from DbLinq source code

    - by Veer
    Hi All, I tried to create linq-to-sqlite dbml using DbLinq but in vain. Each time I get different type of errors. May be I'm somewhere wrong. Can anyone tell me the step by step procedure to create the dbml file from the Dblinq source code. Edit: Steps I Followed: I downloaded the source file from this link. Edited the "run_sqliteMetal.bat" file in \\DbLinq-0.19\src\DbMetal folder as 'DbMetal.exe -database:myDb.db3 -namespace:myNS -code:myCode.cs' -dbml:myDbml.dbml Tried to run the DbMetal project file to produce the executable but there was a runtime error since Options object in Parameters.cs was null. Hence downloaded the readymade exe file from this location Copied it into the \DbLinq-0.19\src\DbMetal folder Executed the "run_sqliteMetal.bat" file I got a blank screen and Windows Error Msg "DbLinq has stopped Working" Any help? Thanks in advance, Veer

    Read the article

  • What happens to date-times and booleans when using DbLinq with SQLite?

    - by DanM
    I've been thinking about using SQLite for my next project, but I'm concerned that it seems to lack proper datetime and bit data types. If I use DbLinq (or some other ORM) to generate C# classes, will the data types of the properties be "dumbed down"? Will date-time data be placed in properties of type string or double? Will boolean data be placed in properties of type int? If yes, what are the implications? I'm imaging a scenario where I need to write a whole second layer of classes with more specific data types and do a bunch of transformations and casts, but maybe it's not so bad. If you have any experience with this or a similar scenario, what are your "lessons learned"?

    Read the article

  • How do you cast a LinqToSql Table<TEntity> as a Table<IEntity> where TEntity : IEntity?

    - by DanM
    I'm trying to use DbLinq with a SQLite database, but I'm running into a problem when I try to cast an ITable as a Queryable<TEntity>. There is a known bug in DbLinq (Issue 211), which might be the source of my problem, but I wanted to make sure my code is sound and, if it is, find out if there might be something I can do to work around the bug. Here is the generic repository method that attempts to do the cast: public IQueryable<TEntity> GetAll() { return Table.Cast<TEntity>(); // Table is an ITable } This compiles, but if I pass in the interface IPerson for TEntity and the type of the entities in the table is Person (where Person : IPerson), I'm getting this error from DbLinq: S0133: Implement QueryMethod Queryable.Cast. Why am I trying to do this? I have a library project that doesn't know the type of the entity until runtime, but it does know the interface for the entity. So, I'm trying to cast to the interface type so that my library project can consume the data. Questions: Am I attempting an impossible cast or is this definitely a bug in DbLinq? How else could I go about solving my problem?

    Read the article

  • Would an ORM have any way of determining that a SQLite column contains date-times or booleans?

    - by DanM
    I've been thinking about using SQLite for my next project, but I'm concerned that it seems to lack proper datetime and bit data types. If I use DbLinq (or some other ORM) to generate C# classes, will the data types of the properties be "dumbed down"? Will date-time data be placed in properties of type string or double? Will boolean data be placed in properties of type int? If yes, what are the implications? I'm envisioning a scenario where I need to write a whole second layer of classes with more specific data types and do a bunch of transformations and casts, but maybe it's not as bad as I fear. If you have any experience with this or a similar scenario, how did you handle it?

    Read the article

  • SQLite doesn't have booleans or date-times...but C# does

    - by DanM
    I've been thinking about using SQLite for my next project, but I'm concerned that it seems to lack proper datetime and bit data types. If I use DbLinq (or some other ORM) to generate C# classes, will the data types of the properties be "dumbed down"? Will date-time data be placed in properties of type string or double? Will boolean data be placed in properties of type int? If yes, what are the implications? I'm envisioning a scenario where I need to write a whole second layer of classes with more specific data types and do a bunch of transformations and casts, but maybe it's not so bad. If you have any experience with this or a similar scenario, what are your "lessons learned"?

    Read the article

  • SQLite doesn't have booleans or date-times.

    - by DanM
    I've been thinking about using SQLite for my next project, but I'm concerned that it seems to lack proper datetime and bit data types. If I use DbLinq (or some other ORM) to generate C# classes, will the data types of the properties be "dumbed down"? Will date-time data be placed in properties of type string or double? Will boolean data be placed in properties of type int? If yes, what are the implications? I'm envisioning a scenario where I need to write a whole second layer of classes with more specific data types and do a bunch of transformations and casts, but maybe it's not as bad as I fear. If you have any experience with this or a similar scenario, how did you handle it?

    Read the article

  • .NET/C# Drizzle database client

    - by FlappySocks
    I am planning to use Drizzle in my next C# Mono app. Since there is no C# client available for Drizzle, I thought I would have a stab at writing my own by converting the Java client, and then making it work with DBLinq. Having seen the Java client, I realise that it's a longer job that I had anticipated, and I don't have the time. Besides the Java client is not all that mature yet. Since there is an official Drizzle C client library (libdrizzle), writing a C# wrapper might be the best solution. Are there any tools available that can assist in generating the code for this?

    Read the article

  • Pass Linq Expression to a function

    - by Kushan Hasithe Fernando
    I want to pass a property list of a class to a function. with in the function based on property list I'm going to generate a query. As exactly same functionality in Linq Select method. Here I'm gonna implement this for Ingress Database. As an example, in front end I wanna run a select as this, My Entity Class is like this public class Customer { [System.Data.Linq.Mapping.ColumnAttribute(Name="Id",IsPrimaryKey=true)] public string Id { get; set; } [System.Data.Linq.Mapping.ColumnAttribute(Name = "Name")] public string Name { get; set; } [System.Data.Linq.Mapping.ColumnAttribute(Name = "Address")] public string Address { get; set; } [System.Data.Linq.Mapping.ColumnAttribute(Name = "Email")] public string Email { get; set; } [System.Data.Linq.Mapping.ColumnAttribute(Name = "Mobile")] public string Mobile { get; set; } } I wanna call a Select function like this, var result = dataAccessService.Select<Customer>(C=>C.Name,C.Address); then,using result I can get the Name and Address properties' values. I think my Select function should looks like this, ( *I think this should done using Linq Expression. But im not sure what are the input parameter and return type. * ) Class DataAccessService { // I'm not sure about this return type and input types, generic types. public TResult Select<TSource,TResult>(Expression<Func<TSource,TResult>> selector) { // Here using the property list, // I can get the ColumnAttribute name value and I can generate a select query. } } This is a attempt to create a functionality like in Linq. But im not an expert in Linq Expressions. There is a project call DbLinq from MIT, but its a big project and still i couldn't grab anything helpful from that. Can someone please help me to start this, or can someone link me some useful resources to read about this.

    Read the article

  • DbMetal chokes on repeated foreign key references in SQLite - any ideas?

    - by DanM
    I've been struggling to get DbMetal to process my SQLite database. I finally isolated the problem. It won't allow a table to have two foreign key references to the same column. For example, a SQLite database with these two tables will fail: CREATE TABLE Person ( Id INTEGER PRIMARY KEY, Name TEXT NOT NULL ); CREATE TABLE Match ( Id INTEGER PRIMARY KEY, WinnerPersonId INTEGER NOT NULL REFERENCES Person(Id), LoserPersonId INTEGER NOT NULL REFERENCES Person(Id) ); I get this error: DbMetal: Sequence contains more than one matching element If I get rid of the second foreign key reference, no error occurs. So, this works: CREATE TABLE Match ( Id INTEGER PRIMARY KEY, WinnerPersonId INTEGER NOT NULL REFERENCES Person(Id), LoserPersonId INTEGER NOT NULL ); But I really need both "person" columns to reference the person table. I submitted a bug report for this, but I could use a workaround in the meantime. Any ideas?

    Read the article

  • Designing a data model in VS2010 and generating ORM code, application

    - by Kay Zed
    Simply put: I have a database design in my head and I now want to use Visual Studio 2010 to create a WPF application. Key is to use the VS2010 tools to take much as possible manual work out of my hands. -The database engine is SQLite -ORM probably through DBLINQ -Use of LINQ -The application can create new, empty database instances -Easily maintainable (changes in data model possible) Q- How do I start designing the database model (visually) in Visual Studio 2010? Should this be an xsd? Do I do this in a separate project? Q- Next, how can I make the most use of VS2010 code generation tools to generate a business layer? Q- I suppose the business layer will be added as a Data Source (in another project?) and from there it's a rather generic data binding solution? I tried finding clear examples of this but it's a jungle out there, the hunt for a solution is NOT converging to one clear method.... :_(

    Read the article

  • SQL Server CE, Visual Studio 2008/2010 RC, and Linq-to-Sql

    - by blu
    I added an .sdf to my project, added a table, added a Linq-to-Sql dmbl, and tried to add the table to the dbml. The result was an error: "The selected object(s) are an unsupported data provider" This happens in both VS 2008 Professional SP1 and 2010 RC Ultimate. I found someone talking about using SQL Metal to generate the file, but I didn't enjoy that 2 years ago, and after a little playing around I recall why. Does anyone know if this is going to be supported in the release version? Should I abandon SQL Server CE and just use SQLite (with DbLinq)? Thanks for any insight.

    Read the article

  • Jointure in linq with a regular expression

    - by Graveen
    I'm actually using a join in linqtosql (via dblinq). I'm trying to include a regular expression in the join part of the linq query. from i in collectiona join j in collectionb on Regex.IsMatch(i.name, j.jokered_name) equals true (...) I agree i can push the RegExp check in the where part of the linq query, but i was wondering if it is possible in the join part ? The above code wants an "i equals j" code structure. One thing i think to perform is overriding Equals() which 'll contains the RegEx.IsMatch() stuff and put a simple i equals j in the join part. Any suggestions about my problem ?

    Read the article

1