开发者

Can i use Linq with SQLite if the tables (and table schemas) are generated at runtime?

开发者 https://www.devze.com 2023-01-31 07:35 出处:网络
Let\'s say I create a random table \"MyTable\" using a SQL statement (\"CREATE TABLE MyTable (col1, col2)\").How can I then use Linq to query that table?

Let's say I create a random table "MyTable" using a SQL statement ("CREATE TABLE MyTable (col1, col2)"). How can I then use Linq to query that table?

from t in MyTable select t.col1

or perhaps

from t in db["MyTable"] select t("col1")

Perhaps this is no开发者_开发问答t possible.


I guess that what you're looking for is a SQLite data provider for Linq. Basically is a library called System.Data.SQLite that enables you to query SQLite databases using Linq.

EDIT:

Ok, since what you want is LinqToSQL support for SQLite, I will suggest you check this article at CodeProject.com: LinqToSQL: Comprehensive Support for SQLite. It features a full tutorial on the topic.

0

精彩评论

暂无评论...
验证码 换一张
取 消