Sign in to follow this  
aleisterbukowski

SQL LINQ startup help please?

Recommended Posts

I know nothing of SQL LINQ besides they're what I would call middleware, API's for working with databases. I would like to create a small database, and see the ins and outs of what it takes to CRUD a database, for I'm interested in databases now. Though I have an internet connection; I was wondering if I could create a fake server on my laptop, and was really wanting to know where is the best stop online for tutorials, references for beginners to learn SQL LINQ using Visual Studio 2008 with no prior knowledge of SQL LINQ, or any other knowledge besides C++, and C#. I consider myself a good coder intermediate coder in C#, C++, Java. The type of tutorial I'm looking for is a huge step-by-step mini lesson long chapters of a book where it will teach you the creation, modification ins and outs of creating a database from scratch maintaining it, querying it, etc in C# using Visual Studio, and if you know of a book that would do this I'll go out and buy it. Thanks,

Share this post


Link to post
Share on other sites
1) Learn SQL separate from anything else. You'll need to know how to CREATE TABLE or SELECT ... LEFT OUTER JOIN before you'll get much out of any database interface package.

2) Go to MSDN to find information about Linq. You can also just google for "linq tutorial".

3) You'll need a database server. Easiest is probably to install a copy of MySQL or PostgreSQL on your machine, as those are both free to download and run. You'll be needing ODBC interfaces ("drivers") for those databases to have Linq talk to them, as well, if I remember correctly.

Share this post


Link to post
Share on other sites
LINQ is just a set of C# extensions.

You're talking about LINQ to SQL, and it's SQL Server specific, if you use the built in ORM tools with Visual Studio.

LINQ to Entities is what you want for a database agnostic ORM/DAL layer system, but it's still beta from Microsoft.

There are LINQ providers for other databases, but really if you want to use LINQ, it's probably best to use a tool like SubSonic or NHibernate to create your DAL/ORM mapping, and simply use the LINQ extensions to collections to in-memory query the data. I find LINQ much more useful for searching lists and data transforming, then I do as an actual technology to reach a database.

Share this post


Link to post
Share on other sites
Quote:
simply use the LINQ extensions to collections to in-memory query the data


Which works well as long as the data fits in memory, and you don't need simultaneous multi-user access.

What WOULD be cool would be a SQLite implementation of Linq...

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
Quote:
simply use the LINQ extensions to collections to in-memory query the data


Which works well as long as the data fits in memory, and you don't need simultaneous multi-user access.

What WOULD be cool would be a SQLite implementation of Linq...


It would...

...but this is why I said I don't use LINQ to actually get to a database ;)

They say LINQ to Entities is supposed to solve a lot of these problems, and allow you to query against a database agnostic ORM layer, but we'll see. I haven't played with the beta yet.

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
1) Learn SQL separate from anything else. You'll need to know how to CREATE TABLE or SELECT ... LEFT OUTER JOIN before you'll get much out of any database interface package.

2) Go to MSDN to find information about Linq. You can also just google for "linq tutorial".

3) You'll need a database server. Easiest is probably to install a copy of MySQL or PostgreSQL on your machine, as those are both free to download and run. You'll be needing ODBC interfaces ("drivers") for those databases to have Linq talk to them, as well, if I remember correctly.


I definitely agree with 1 and 2, though for 3 I'd have to say that if you're looking to learn LINQ, you should go with SQL Server Express instead

Share this post


Link to post
Share on other sites
Why? LINQ is just a set of compiler extensions. You can learn the syntax just as easy using LINQ to Collections or LINQ to XML, and never connect to SQL Server.

In fact, to really "get" LINQ you need to understand new anonymous type and lambda support in C#, which is a bigger part of LINQ (in my mind) than the added syntactic sugar keywords. Those keywords, in fact, are just sugar for IQueryable<T> calls. In fact, the LINQ to Collections stuff is really just extension methods that provide IQueryable<T> functionality to collections.

LINQ is not a database technology, it's Language Integrated Query. It doesn't give two shakes what you are actually querying, and this is a very important distinction.

Share this post


Link to post
Share on other sites
Quote:
Why? LINQ is just a set of compiler extensions. You can learn the syntax just as easy using LINQ to Collections or LINQ to XML, and never connect to SQL Server.


Maybe because he's not just interested in LINQ, but also using it for database access? Yes, LINQ isn't just tied to database usage, but it is a common application for it that has probably the most information available online

Share this post


Link to post
Share on other sites
Quote:
LINQ is not a database technology, it's Language Integrated Query. It doesn't give two shakes what you are actually querying, and this is a very important distinction.


If the implementation doesn't know what you're querying, it can't be made efficient, so it actually does care at some level. Similarly, if YOU don't know what you're querying, then you won't write efficient queries. Nothing is free.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this