I'm trying to render the contents of a generated LinqToXsd class into a custom system.Windows.forms.Propertygrid
I've created the converter class by inheriting system.Componentmodel.ExpandableObjectConverter and all is well there.
My problem is trying to apply the TypeConverterAttribute to the LinqToXsd generated class as this gets reg...
Hello,
I'm working on a sample from the book I bought. And, for unknown reason, I get the following error message " Could not find an implementation of the query pattern for source type 'System.Type'. 'Where' not found."
The VS2008 help says that I need to add System.Linq and System.Collections namespaces to solve the issue. Unfortun...
Hi,
Im starting to use ado.net data services in a little silverlight application that Im putting together.
Currently I'm using it in the most simplistic was possible:
var teams = (from t in ents.tblTeams
select t) as DataServiceQuery<tblTeams>;
teams.BeginExecute(
(ar) => this.cmTeams...
select ID, 0 as Index from Table;
How do I do this query in linq?
var o = From X in Table Select X.ID, (0 as Index) <- error
...
I need to define a one-to-one relationship, and can't seem to find the proper way of doing it in SQL Server.
Why a one-to-one relationship you ask?
I am using WCF as a DAL (Linq) and I have a table containing a BLOB column. The BLOB hardly ever changes and it would be a waste of bandwidth to transfer it across every time a query is ma...
Using VB.NET (3.5), i have an ArrayList of Employees. I'm trying to build an XML representation (to feed another system) and one of the fields is a simple incrementing ID, starting at 1. The code I currently have is:
Dim Emps = <Employees>
<%= From ee As Employee In Employees _
Select <Employe...
How do I do this query in linq? All the tables already are list of objects.
This query give points to entities named "Empresas" (Companies) that fills the "Palavras" (Words) criterias.
select x.empresaid, sum(x.pontos)
from (
select a.empresaid, sum(1) as Pontos
from empresa a
inner join Palavras b on a.nome like '...
I look for some exaple how use the stora procedurs in MVC with LINKQ.
...
Hello,
I trying to compare two dates (DateTime) in nhibernate linq:
query = query.Where(l => (l.datCriacao.Date == dtLote.Date)
but the error:
NHibernate.QueryException: could not resolve property: datCriacao.Date of: SAGP.Entities.Lote
anyone knows how I can solve this?
tks
...
Why did the anonymous type property "Points" still have the value "0"?
Public Class Test
Public Sub New(ByVal _ID As Integer)
ID = _ID
End Sub
Public ID As Integer
End Class
Dim list As New List(Of Test)
list.Add(New Test(1))
list.Add(New Test(2))
list.Add(New Test(3))
Dim query = From X In list Select New With {....
Is there an elegant way of doing this? Perhaps with Linq?
For something like this:
List<ControlCollection> list = { ... }
List<Control> merged = list.MergeAll();
EDIT: The final collection will be single dimensional in a sense that all controls will be there, not in a nested way.
...
Lets say I have 3 tables Posts, PostTags and Tags defining a many-to-many relationship. I want to get a lookup table that will give me all the Posts related to a given tag so I use the following code:
return dataContext.PostTags.ToLookup(pt => pt.Tag, pt => pt.Post);
In unit test all went fine but in the real application, it didn't wo...
Hi All
Maybe it's something I'm doing wrong. I'm just learning Linq because I'm bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control.
usage: enter text into textbox, click button. program lets you select a file to match the textbox value against and returns matches ...
Hi,
I have a List of objects (string filename, BitmapImage image) to use as a cache of images.
private static readonly List<ImageData> imageCache = new List<ImageData>();
I created a Lookup to check this cache for an image each time it is required. If the image is not in the list it is added to the list.
The Looked is statically cre...
I have a List<> of custom objects. This custom type has a property called Name which should be unique among the list. In other words, no 2 items items in the list should have the same value for their Name property.
When I validate this list, I want to retrieve the offending items. Is there a Linq operation which will allow me to do thi...
I'm working with a set of legacy DAO code that returns an IList, where each Hashtable represents the row of a dynamically executed SQL query. For example, the List might contain the following records/hashtables:
Hashtable1:
Key:Column15, Value:"Jack"
Key:Column16, Value:"Stevens"
Key:Column18, Value:"7/23/1973"
Key:Column25, Value:"Act...
Hi
I have two tables, Tags(tagid, postid, tagname) and posts(postid, name, ...)
now i want to make a query that returns me all posts that have a generic amount of tags.
like: i want all posts that have the tag asp.net AND jquery
as i said, the amount of tags to look for is generic
how can i do something like that?
thx
update 17.11.20...
Using linq? and XML is there a way to convert this IEnumerable to a string array of the value parameter?
List<string> idList = new List<string>();
foreach (XElement idElement in word.Elements("id"))
{
idList.Add(idElement.Value);
}
string[] ids = idList.ToArray();
It would be similar to
this
But I need the XElement.Value paramete...
Suppose I have three tables:
Person(pid, ...)
PersonAddress(pid, aid,...)
Address(aid, ...)
Then I want to get the person address like sql:
select a.* from address a join PersonAddress pa on a.addressID=pa.addressID
where pa.personID = myPersonID
Use Entity Framework to create Entity model, then want to write a linq equivalent as ...
Hi, i have a question about linq. I'm using Skip and Take to do paging:
(from l in db.ProductList
select l).Skip((page - 1) * row_per_page).Take(row_per_page)
It work, and i need retrieve total rows of product list to calculate max page. I think i must use another query to count rows but have another way to do this in one qu...