Questions tagged [dblinq]

56 questions
2
votes
1 answer

problem with linq to sqlite

I am using vb.net sqlite.net and dblinq0.20.1 to search a sqlite table on a primary key field. My code looks like this Dim blb = (From d In db.Data Where d.UID = myuid Select d).Single This returns the error "Coalesce used with type that cannot…
2
votes
2 answers

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

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. There is a known bug in DbLinq (Issue 211), which might be the source of my problem, but I wanted to make sure my…
devuxer
  • 41,681
  • 47
  • 180
  • 292
2
votes
1 answer

Create Records with Linq to SQLite via DbLinq

I have (after some significant effort) gotten DbLinq working with the latest build of Mono on OS X. Has anybody successfulyl created database entities via DbLinq/Sqlite? For example, I have the following table: CREATE TABLE UserType ( id integer…
Justin Niessner
  • 242,243
  • 40
  • 408
  • 536
2
votes
1 answer

DBMetal generating an invalid class for sqlite_sequence

I'm using DBLinq and DBMetal.exe to generate Linq-to-SQL like classes off an SQLite database. Every time I use DBMetal to regenerate my DataContext, it generates a class for sqlite_sequence. The trouble is is that sqlite_sequence isn't a proper…
sgwill
  • 9,814
  • 8
  • 35
  • 40
2
votes
3 answers

.NET/C# Drizzle database client

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,…
FlappySocks
  • 3,772
  • 3
  • 32
  • 33
1
vote
1 answer

Pass Linq Expression to a function

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…
Sency
  • 2,818
  • 8
  • 42
  • 59
1
vote
1 answer

.NET 4.0 + Linq + SQLite + DbLink - how do I make it all work together?

I'm developing (or trying to develop) a project in C# which stores data in an SQLite database. I'd like to use Linq for object-relational mapping. According to what I've read it's possible to use it with SQLite if you download System.Data.SQLite and…
lampak
  • 890
  • 1
  • 9
  • 21
1
vote
1 answer

How to serialize instances of classes generated by DbMetal?

I noticed DbMetal generates classes that don't implement the ISerializable interface, nor are marked with DataContractAttribute. What is the easiest way of serializing such classes? Is there any DbMetal parameter that could help me?
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
1
vote
2 answers

DbLinq generic extension method - string as keyselector?

The following snippet indicates what I want: public static class DblinqExtension { public static int MaxId(this DbLinq.Data.Linq.Table table) where T : class { var val = table.OrderByDescending(x => "Id").FirstOrDefault(); …
321X
  • 3,153
  • 2
  • 30
  • 42
1
vote
0 answers

How to use functions/variables in DBLinq.MySQL

This is my query: SELECT IF(@@old_passwords, Old_Password(?), Password(?))=`password` AS pass FROM mysql.user WHERE User=? Can I translate this to Linq, or do I have to just extract the connection from the data context and do it the old way? All…
Patrick
  • 1,766
  • 1
  • 15
  • 27
1
vote
0 answers

Connecting/Querying Data Access Database in C# using DBLINQ

Bear with me, I'm new to databases. I have an Access database, "Database.accdb". It's located on my local computer: "C:\Users\MyUserName\Documents\Database.accdb". I have a C# program trying to establish a connection with this database. I attempt to…
Misha
  • 11
  • 1
1
vote
1 answer

How to include an auto generated file in a MsBuild project?

Using MsBuild 4.0 I included a pre-build event that generates one of the project source files. But it seeks for the file before it is generated: error CS1504: Source file 'c:\src\Data\Main.Designer.cs' could not be opened ('Unspecified error…
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
1
vote
1 answer

How to set the DataContext class name with DbMetal?

DbLinq's DbMetal generates a Main class which inherits DataContext. I don't want it to be Main. How to change that?
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
1
vote
0 answers

dbLinq Sqlite select from multiple databases

I'm not able to find any answer to my problem. I have two database, local and custom, and I need to join certain tables from both DBs between them. But I'm getting errors as for example "No such table PcApplicationsComponents". My code is: using…
Eli Kelly
  • 11
  • 2
1
vote
1 answer

Does Mono support correct handling of System.Data.Linq.Mapping.AssociationAttribute

I can't make my application to insert into a table with foreign key relation. I'm using SqLite3 & Mono 2.8. My sqlite scripts look as follows: CREATE TABLE IF NOT EXISTS appointments ( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(100)…
ILya
  • 2,670
  • 4
  • 27
  • 40