SQL LINQ startup help please?

Started by
9 comments, last by hplus0603 15 years, 9 months ago
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,
Advertisement
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.
enum Bool { True, False, FileNotFound };
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.
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...
enum Bool { True, False, FileNotFound };
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.
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

"Game Programming" in an of itself does not exist. We learn to program and then use that knowledge to make games.
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.
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
"Game Programming" in an of itself does not exist. We learn to program and then use that knowledge to make games.
There are far, far, far more LINQ to Collection examples on the net than any of the other LINQ technologies, and it's not even close.
You can find more help at linqhelp.com.

This topic is closed to new replies.

Advertisement