473,239 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,239 software developers and data experts.

Special LINQ group available?

Hi group,

is there a special C# LINQ group available?

Regards
Jun 27 '08 #1
5 1257
There are a few managed forums for LINQ, but various people here can
probably assist too...

The LINQ Projecft General managed forum is here (at least until the big
move):
http://forums.microsoft.com/MSDN/Sho...D=123&SiteID=1

Marc
Jun 27 '08 #2
Intersting... I didn't know that @@DATEFIRST didn't work on SQL CE,
but then - I didn't know that LINQ-to-SQL *did* work on SQL CE ;-p

You could perhaps try just selecting the date (o.Date) from the
database (perhaps calling ToList() or ToArray() to buffer it locally),
then do a second projection afterwards?

var tmp = context.Absences.OrderBy(o =o.Date).Select(o =new {
o.Department, o.Name, o.Date, o.Reason }).ToArray();

var absenses = tmp.Select(o =new {
o.Department, o.Name, o.Date.Month, o.Date.DayOfWeek,
o.Reason });

That might fix it?

Marc
Jun 27 '08 #3
Oh, that's a great idea, and indeed - it works :)
I already managed to do the .DayOfWeek things in the iteration loop, but
your solution is much smarter than this.

Great.

Yes, Linq-to-SQL does work on SQL CE perfectly. But it doesn't work
automatically. You have to manually "SQL-metalize" the database, whenever
you change the table layout. There is a couple of blogs out, describing this
issue. The tool "sqlmetal.exe", required for this, is available in the SDK.
(Program Files\Microsoft SDKs\Windows\v6.0A\bin)

In my case I always run

SqlMetal.exe Database.sdf /dbml:KS.dbml /namespace:KS /pluralize

This produces KS.dbml, which I import into my project every time it is
changed (delete/add). The KS.designer.cs then contains all the classes
required for nice and smart "CRUDs". Because the structure of my db doesn't
change that frequently I can live with this small manual interaction.
I never worked with a SQL database easier.

Regards and thanks again for your assistance
Neil.
"Marc Gravell" <ma**********@gmail.comschrieb im Newsbeitrag
news:7d**********************************@l42g2000 hsc.googlegroups.com...
Intersting... I didn't know that @@DATEFIRST didn't work on SQL CE,
but then - I didn't know that LINQ-to-SQL *did* work on SQL CE ;-p

You could perhaps try just selecting the date (o.Date) from the
database (perhaps calling ToList() or ToArray() to buffer it locally),
then do a second projection afterwards?

var tmp = context.Absences.OrderBy(o =o.Date).Select(o =new {
o.Department, o.Name, o.Date, o.Reason }).ToArray();

var absenses = tmp.Select(o =new {
o.Department, o.Name, o.Date.Month, o.Date.DayOfWeek,
o.Reason });

That might fix it?

Marc

Jun 27 '08 #4
Re sqlmetal - I've found that most incrememtal changes are easier
simply by editing the dbml directly. Fortunately LINQ-to-SQL has
simple markup - I wouldn't try this with Entity Framework - but then
EF includes better tooling for database changes (which still doesn't
help very much if the designer doesn't like your database...).

One other trick I've used (in similar scenarios to the SQL CE) is to
setup the database on something that the designer DOES like [SQL
Express being the obvious choice], then just supply a different
connection string at runtime. That way you get the richer designer
experience, while still running against your chosen platform
(fortuantely the decisions about SQL dialects is made at runtime, not
compile/design time).

Marc
Jun 27 '08 #5
Oh, sorry. Seems you know more about that than me :)

From your statement
>but then - I didn't know that LINQ-to-SQL *did* work on SQL CE ;-p
I didn't expect, that you would have _any_ experiences with SQL CE.

Kind reagards
"Marc Gravell" <ma**********@gmail.comschrieb im Newsbeitrag
news:05**********************************@c65g2000 hsa.googlegroups.com...
Re sqlmetal - I've found that most incrememtal changes are easier
simply by editing the dbml directly. Fortunately LINQ-to-SQL has
simple markup - I wouldn't try this with Entity Framework - but then
EF includes better tooling for database changes (which still doesn't
help very much if the designer doesn't like your database...).

One other trick I've used (in similar scenarios to the SQL CE) is to
setup the database on something that the designer DOES like [SQL
Express being the obvious choice], then just supply a different
connection string at runtime. That way you get the richer designer
experience, while still running against your chosen platform
(fortuantely the decisions about SQL dialects is made at runtime, not
compile/design time).

Marc

Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Chris | last post by:
I am a little confused. I have been reading about LINQ and it seems to imply LINQ is available in C# 3 but not in Visual Studio until the next release. I am a VB.net programmer but would still like...
28
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to...
0
by: fiona | last post by:
Reading, Berkshire, UK 05 June 2007 - Crainiate Software make details available of the release of Objecto Framework 2.0, an upgrade to their enterprise business component framework, designed to...
3
by: clintonG | last post by:
I like the idea of LINQ but don't have the resources for Orcas at this time and know little about the requirements for LINQ. Anybody want to give me a quick earful? <%= Clinton Gallagher NET...
4
by: shapper | last post by:
Hello, I have 2 tables: Aid, Aname ... Bid, Aid, Bname ... I need to get the records in B given a Bname and a Aname. I think I should use Inner Join. I wrote the following code:
8
by: Alcides | last post by:
Hello all, I learn about LINQ here in this forum. I been a VB.NET programmer for quite a while and we are using an internal solution for SQL access. I have some experience with C# and I started...
9
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
Hi all: after reading different places/sites about linq... I ran into these questions: 1. What framework do we need to run linq ? (does it depend on what version of visual studio we have?) how...
14
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
2
by: shapper | last post by:
Hello, I have the following Linq query: List<PostsTaginsert = (from t in (from t in database.Tags join p in paper.Tags on t.Name equals p.Name select t).ToList() select new PostsTag {
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.