Hi group,
is there a special C# LINQ group available?
Regards 5 1286
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.Absence s.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.DayOfWee k,
o.Reason });
That might fix it?
Marc
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.e xe", 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**********@g mail.comschrieb im Newsbeitrag
news:7d******** *************** ***********@l42 g2000hsc.google groups.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.Absence s.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.DayOfWee k,
o.Reason });
That might fix it?
Marc
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
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**********@g mail.comschrieb im Newsbeitrag
news:05******** *************** ***********@c65 g2000hsa.google groups.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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 to know how, if possible, do I
go about using LINQ. When they say it won't be available until Visual Studio
2007 does that mean there won't be out of the box support for it (e.g.
controls built for it) but you can use the classes if you have the...
|
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
write a safe but easy implementation (i.e. no codedom) for an
IBindingListView.Filter (by compiling to a Predicate<T>).
Anybody know if this is possible at all?
Marc
|
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 make it easy for
programmers to create agile persisted business objects that are
reusable, customisable and scalable, without additional developer
tools.
Objecto uses object persistence and managed database technology to
allow developers to...
|
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 csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
|
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:
| |
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 to write a blog to share my
experiences with a sql framework.
I would like to hear some opinions about LINQ, is it the main thing
when accessing sql now? what are the main advantages/disavantages
using it. Nothing fancy, just drop a few lines...
|
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 about vs2008?
is it different name space or framework for linq xml or linq sql? (
2. do we need to have references to what linq's dlls. or namespaces?
system core?
3. what name spaces are needed?
|
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
|
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 {
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |