Hi,
It is my understanding that System.Core.dll and System.Xml.Linq.dll are supported (or will be) in SQL server 2008.
I am trying to use Linq to Objects in my SQL 2008 CLR project.
How would I go about "adding" / registering those dlls? (I can't add them as references)
Thanks in advance,
Orry
...
Friends,
I know how to deploy and retrieve a single element in LINQ, but how can I do to change all the properties in a list. In the line below, I can only modify a record, I would modify several.
_ListaAcaoMenuInfo.Where(p => p.Id_acao == id).FirstOrDefault().Id_menu = 0;
Thanks
...
I am trying the to query my Status Update repository using the following
var result = (from s in _dataContext.StatusUpdates
where s.Username == "friend1" && s.Username == "friend2" etc...
select s).ToList();
Insead of using s.Username == "friendN" continously is there anyway I can pass a list or...
If given a an entity with a datetime as a string... what are my options to filter the data with Linq to Entities on the date?
It does not seem to support me doing datetime conversions.
Basically, I want to accomplish:
var filtered = from item in entities.itemsSet
where Convert.ToDateTime(shift.starttime) >...
I'm slowly learning the ins and outs of LINQtoSQL, but this is confusing me.
Here is the statement I have:
IQueryable<IEvent> events = (from e in db.getEvents()
select e).Select(x => SelectEvent(x, null));
What the SelectEvent does can be explained in this answer here. I am not using the .toList() functio...
I need to do the following thing:
var a = from c in DB.Customers
where (from t1 in DB.Table1 where t1.Date >= DataTime.Now
select t1.ID).Contains(c.ID) &&
(from t2 in DB.Table2 where t2.Date >= DataTime.Now
select t2.ID).Contains(c.ID)
select c
It doesn't want to run. I ...
I've been working on a little property search engine while I learn ASP.Net MVC. I've gotten the results from various property database tables and sorted them into a master generic property response. The search form is passed via Model Binding and works great.
Now, I'd like to add pagination. I'm returning the chunk of properties for ...
I recently switched from using Linq to Sql to the Entity Framework. One of the things that I've been really struggling with is getting a general purpose IQueryable extension method that was built for Linq to Sql to work with the Entity Framework. This extension method has a dependency on the Like() method of SqlMethods, which is Linq to...
Hi,
I would like to know if its possible to discard changes of only one record of only one table in datacontext.
I use databind to bind my controls on a form. I modify one record at a time. after the modification, the user have to hit save button to validate. But he can hit cancel. I would like that the cancel button discard all the ch...
In .NET 4, there's this Directory.EnumerateFiles() method with recursion that seems handy.
However, if an Exception occurs within a recursion, how can I continue/recover from that and continuing enumerate the rest of the files?
try
{
var files = from file in Directory.EnumerateFiles("c:\\",
"*.*", SearchOpti...
I have a settingspropertyvaluecollection.I dont want to loop through all the properties using a for each loop.Instead i want to query the collection.How do i do that?is there a way to use LINQ and do it?
Thanks
...
Hi ,
We want the query result should be assigned with two results based on some condition like following:
var vAudioData = (from xAudioinfo in xResponse.Descendants(ns + "DIDL-Lite").Elements(ns + "item")
if((xAudioinfo.Element(upnp + "artist")!=null)
{
select new RMSMedia
{
strAudioTitle = ((string)xAudioinfo.Element(dc + "title")).T...
This works:
from x in table.AsEnumerable()
where x.Field<string>("something") == "value"
select x.Field<decimal>("decimalfield");
but, this does not:
from x in table.AsEnumerable()
.Where(y=>y.Field<string>("something") == "value")
.Select(y=>y.Field<decimal>("decimalfield"));
I also tried:
from x in table.AsEnumerable()
.Where(y=...
Hi!
I'm trying to run the Count() function of a Linq statement in an overriden Gridview function. Basically, I want to be able to assign a linq query to a gridview, and on the OnDataBound(e) event in my new extended gridview have it retrieve the count, using the IQueryable.
So, I need to dynamically cast the GridView.DataSource to my L...
Im making this method retrieve records from the Data Base. As you can see i Want to return a List where ITieneID is an Interface defined on my business layer.
AtlasWFM_Entities.Clases.Area implements that interface. It is pretty clear that this is not a good way to accomplishing it (even though it compiles correctly)
public override L...
In LINQ to Object context ,can i update an object in memory.
I mean i can create new type like
var query =from e in empList
select new {id=e.id,salary=e.salary * (10/100) };
can i update an object?
...
Hello! I write a simple OLAP viewer for my web-site. Here are the classes (abstract example):
Employee
{
ID;
Name;
Roles[]; //What Employee can do
}
Order
{
Price;
Employee Manager;
Employee Executive; //Maybe wrong english. The person which perform order
}
Employee can be Manager and Executiv...
How can i make an extension method that will work like this
public static class Extensions<T>
{
public static IQueryable<T> Sort(this IQueryable<T> query, string sortField, SortDirection direction)
{
// System.Type dataSourceType = query.GetType();
//System.Type dataItemType = typeof(object);
//if (data...
I have a task where I need to translate a DataTable to a two-dimensional array. That's easy enough to do by just looping over the rows and columns (see example below).
private static string[,] ToArray(DataTable table)
{
var array = new string[table.Rows.Count,table.Columns.Count];
for (int i = 0; i < table.Rows.Count; ++i)
...
I have a page on which I've thrown a LinqDataSource and a GridView. I've created a DataContext LINQ-to-SQL class called dcResidents.dbml. When I attempt to configure the LinqDataSource to utilize the dcResidents data context - it doesn't appear in the list of options...though under class view (tab in VS) it does appear.
I do have several...