Fog Creek Software
Discussion Board

Built-in SQL support in C#

Looks like Microsoft is putting SQL everywhere, lately. Their language C# is no exception. The next release of the .NET framework will feature a C# compiler with native, *syntactical* support for relational datasets. You can define arbitrary datasets in your code and run SQL queries on them. And did I mention it's type-safe, too? See the sample code on this page:

< >

Look for the phrase "strongly typed, real SQL-select queries over arbitrary object graphs" and scroll down a bit. While you're at it, scroll down a little more to witness another new feature in the next release: XML literals for object construction. The release in which the kitchen sink will be included hasn't been disclosed yet

(I can almost hear the sound of a hundred thousand Java coders screaming in pain/horror/hilarity)

Thursday, March 25, 2004

Ah, the wheel of reincarnation turns!

Remember distributed query processors? Remember client-side database libraries with their own SQL parsers and partial evaluators? Remember the nasty difficulties of programming when you needed to constantly transform and restructure tree-structured data? Remember the OBJECT tag? Hmmm, that one still leaves a bad taste...presumably Erik will leave out reference semantics and behaviors...but that doesn't leave much of an "object", does it?

Still waiting for LISP
Thursday, March 25, 2004

SQL will still talk best to the data

A good link
Thursday, March 25, 2004

Umm, that's not going into the next version of C#. It's a research paper, with some neat ideas, but not something that's going directly into the language anytime soon.

Chris Tavares
Thursday, March 25, 2004

> Umm, that's not going into the next version of C#

really? I guess the mention of the PDC mislead me - re-reading the article now I see my mistake. By the way, I don't know whether to be disappointed or relieved by this

Thursday, March 25, 2004

I feel almost like I'm becoming a Delphi evangelist on JoS lately, but I can't resist.  A component has been available to do this with Delphi datasets for several years:

Cost a few bucks ($50) but I've heard reports that it works very well so long as you restrict it to datasets with reasonable numbers of records; it slows down in comparison to a database if you try to use it with datasets with too many records. 

Herbert Sitz
Thursday, March 25, 2004

The big white paper for Xen or X# or whatever they call it this week is here:

Tim Meadowcroft
Friday, March 26, 2004

I've been using SQLJ to help write Java Stored Procedures in Oracle.

With a little refinement (line numbers in exception reports don't match up to your code), it could be a happy middle ground.

However, I find it highly ironic that Joel is asking for these kind of features.  Hasn't he heard about this thing called "The Law of Leaky Abstractions"?  Relational Data mixed in a OO language is one hell of an abstraction.  It's bound to leak like a collinder.

Richard P
Friday, March 26, 2004

"I feel almost like I'm becoming a Delphi evangelist on JoS lately"

Herbert, I'll be your co-evangelist <g>.  Although with MS and Borland getting so close lately, I think C# will be seen more and more as Anders' son-of-Delphi.  Rumors here in Seattle area is that Anders still says great things about Delphi within the hallowed halls of Redmond.

Joe Hendricks
Friday, March 26, 2004

PowerBuilder is neat, too.  Check out datawindows.

Friday, March 26, 2004

As I understand it this will give you the persistence layer that most people are wanting:

it basically takes a schema and "generates" the classes that you work off of in base classes.

Friday, March 26, 2004

*  Recent Topics

*  Fog Creek Home