LINQ to SQL -DAL - c#

I wish to Implement LINQ-to-SQL as my Data Access Layer. I am using SQL Server. Is there
any Linq-to-SQL framework (commercial or open source) available that can function like
Application Block (caching block, validation, etc..)?

Microsoft provide a Linq to SQL framework. There are plenty of articles about it in the web, e.g.
LINQ to SQL
Using LINQ to SQL (Part 1)

Related

mySQL + LINQ to SQL in C#

I've been looking around for a definitive answer as to how to use LINQ to SQL with mySQL but can't seem to come up with anything. Does anyone have any experience / suggestions using the two together? In particular, I would like to avoid using string SQL statements.
Cheers
MySQL isn't directly supported by Microsoft's LINQ to SQL provider, but there are several alternative ways you can use LINQ against MySQL.
Take a look at using LINQ to nHibernate, or see here for LINQ providers against non-Microsoft databases.
Now (as of 2015) you can use the Connector/NET provided by MySQL.
http://dev.mysql.com/doc/connector-net/en/connector-net-tutorials.html

LINQPad: LINQ to SQLite DataContext via System.Data.Sqlite

I'm fairly new to LINQ and trying to find a more elegant way (other than ADO.Net) to query and manipulate data in a SQLite database. I'm using System.Data.SQLite and wondering if there is a DataContext class or a way to use DataContext class to work with SQLite.
I believe LINQPad uses the same assembly for its SQLite/MySQL driver and with it I can execute C# expressions like so:
from c in Collection
where c.Length > 3
select c
What can I do to use those same LINQ expressions with my SQLite databases in my applications?
System.Data.SQLite supports the ADO.NET Entity Framework, so you should be able to just add an Entity Framework mapping and point it to your SQLite connection.
http://sqlite.phxsoftware.com/sqlite.wmv
Basically, Linq-to-SQL as is only support SQL Server as its backend.
You need to look at some third-party extension, like:
DBLinq
LinqConnect
Those additional tools allow you to use Linq-to-SQL against a variety of backend database stores, including SQLite.

Which DB? Linq to SQL classes

I want to develop a multiuser supporting accounting management application in C#.
I want to use Linq To SQL classes. LINQ to SQL only supports SQL Server/Compact. However is it possible the SQLite people have written their own LINQ provider given the name of the assembly.
I have to use DBMS that is FREE. Which DBMS do you suggest to me?
LIN2SQL = SQL Server. Second class badly written O/R mapper compared to the real contendors (like NHibernate).
LINQ2SQL != LINQ. LINQ is the query integration into the langauge, and supported by pretty much a lot of O/R mappers out there, and some databases.
I have to use Db that is FREE.
Free like for free? What is against sql server? Express edition - 0 USD. And the 4gb "database size limit" does not stop you from writing accounting systems. THat is a LOT of space for accounting data. For many years of accounting data.
If you want to use Linq-to-SQL (which I think is an excellent choice) you have to use some variant of MSSQL. Both Sql Server Compact and Sql Server Express are free to use. If you have a multiuser scenario you will have to go for Sql Server Express as Sql Server Compact doesn't allow multiple simultaneous access.
There are various experimental linq to sql and linq to entity framework providers for other databases(like mysql and postgres) - in my experience they are so immature it is not worth using for anything serious.
For now, I'd suggest you'd look for something else if you cannot use SQL server.
Try the following link:
http://sqlite.phxsoftware.com/
Note that Linq2SQL is not compatible with SQLite, however the link points to an Entity Framework provider for SQLite. EF is kind of like Linq2SQL on steroids. SQLite is very lightweight, so the EF implementation above should work nicely for your needs.

how to generate dbml file from Sybase database?

I think we may have trouble with our existing project. For some reasons we have to switch from SQL Server to Sybase SQL Anywhere 11. now we trying to find a way continue use our existing LINQ code.
We wish we can still use L2S? If cannot, we wish we can use L2E, then we have to change to ADO.
how to generate dbml file from Sybase Anywhere 11? after that can we use sqlmetal to generate .cs files?
Linq to SQL only supports MS SQL Server. You might consider switching to Entity Framework if this is an option and if there is a provider fro Sybase SQL Anyware.
As far as I know there are also no plans to extend the Linq to SQL support to other databases, especially as MS pushes EF as the future database technology.

How do you use LINQ with Sqlite

Would someone explain how to get LINQ working with Sqlite.
Here you have an SQL Linq provider for SQLite, and some other DBs
Joe Albahari's LINQPad now supports Sqlite: http://www.linqpad.net/Beta.aspx. The one LINQ tool to rule them all.
The link provided by CMS doesn't work anymore. I have used this one as it now seems to be baked into their SQL lite ADO .NET provider.
Unfortunately they still don't support the designer mode of VS for creating classes :(
Also be aware that SQL Server compact doesn't support the design mode for LINQ classes! However if you want to use the entity framework the designer does work for SQL lite and SQL Server compact :)
Yup there is a SqlLite Linq Provider as mentioned by CMS
Check out SQL server compact and it works well with Linq
There is another thread on SO which you should check
I would like to add that you can use Linq to Sql with SqlLite with a couple of stipulations:
You cannot use the Linq to Sql designer which means you have to hand roll your classes.
You have to be careful not to do certain operation which will result in Sql code which is not supported by SqlLite.
For example, you cannot use FirstOrDefault() in any of your Linq queries because it will result in something like:
select top 1 * from table where ...
Since SqlLite doesn't support the "top 1" syntax, you will gt a runtime Sql error.
Other than that, I have been using Linq to Sql with SqlLite with great success for basic CRUD operations.
You can use this: http://code.google.com/p/dblinq2007.
Although it looks like the project is still in Alpha stage, IMO it is actually very stable now. Of course if you have a huge project, it is better to consider using something else like MySQL or SQL Compact. I don't like SQL Server, because it is too bloated, and offers not many more functionalities over SQL Compact or MySQL
Check this provider:
SqlLite Linq Provider
Also you can consider using SQL Compact which has very good LINQ-to-SQL support.
On this time there is NO good tools to do this!
LINQ providers for SQLite all is in alpha stage (for example:dblinq2007). And it is very big risk to use it in commercial purpose! So maybe in future...
If you want ot use ADO.NET there is good ove: phxsoftware.

Categories

Resources