I have an object that has a property:
[Column]
public Binary Image { get; set; }
When the object is saved the first time every this is OK, but when it is modified I get an exception on SubmitChanges:
The data types image and
varbinary(max) are incompatible in the
equal to operator.
What might be the problem here?
...
I have a collection of data that checks if there is a change in a particular field to get the sum for another column.
Total = Details.Where(s=>s.indicator != *prior indicator before this...).Sum(s => s.amount);
...
How is it possible to force extra spacing between some nodes using Linq to Xml? I am looking to output the following:
<root>
<group>
<leaf />
</group>
<group>
<leaf />
</group>
</root>
By adding Empty XText, it only destroys the formatting.
var root =
new XElement("root",
new XText(""),
...
I'm debating what technology to use for an upcoming ASP.NET project.
Assumptions:
I will be using Visual Studio 2008 SP1 (.NET Framework 3.5)
The back-end will be a SQL Server 2005 database (or possibly 2008)
Code will be written in C#
I already have experience with LinqToObjects and LinqToXml
I also have experience with ADO.NET and s...
Hello!
Assume that we have class
public class RMenuItem
{
public List<RMenuItem> ChildrenItems { get; }
public decimal OperationID { get; }
public string Name { get; }
}
as you can see - each menuitem could have children items - as usual in menu.
My task is to iterate through each items of this list and apply some action...
I have a set of Entities which basically has this structure.
{Stats Name="<Product name> (en)" TotalResources="10" ..}
{DayStats Date="2009-12-10" TotalResources="5"}
{DayStats Date="2009-12-11" TotalResources="5"}
{Stats}
{Stats Name="<Product name> (us)" TotalResources="10" ..}
{DayStats Date="2009-12-10" TotalResources="5...
I have 2 Linq2Sql classes: Parent and Child. I want to do things like removing all children for a parent, or updating all child records. In SQL I would have written:
delete Child where ParentID = @p
or
update Child set Val = Val+1 where ParentID = @p
I can do this in Linq the brute force way inside the Parent class:
Children.ToL...
Can someone please give me a simple explanation of an inner equijoin?
I'm finding explanations found via google quite hard to understand.
...
Does anyone know if there's a library that will allow you to Query the HTML DOM with LINQ?
Something like LINQtoHTML.
Would it be useful to create such a thing if it does not exist yet?
...
If you need to be able to store a large amount of plain text in memory so it can be searched and edited, what kind of datatype would you use?
Let's say I load a 10000 line document into my C# application for searching with LINQ, how would you represent it in memory?
Not a string, because it's got be mutable, and strings are immutable.
...
Hello all.
I am following the good old Scott Gu LINQ to SQL guide to LINQ and have stumbled upon a query.
Here is my scenario. I have a textbox a client should populate with a number (tbxHowMany), two radio buttons that define a material (radPaper & radGlass). A also have a button (btnReturn) that when clicked, a gridview (gridview1) ...
I'm trying to write a simple program that will compare the files in separate folders. I'm currently using LINQ to Objects to parse the folder and would like to included information extracted from the string in my result set as well.
Here's what I have so far:
FileInfo[] fileList = new DirectoryInfo(@"G:\Norton Backups").GetFiles();
v...
I'm thinking of using SqlMetal to auto-generate LinqToSql code for a simple and small database. The database will have only tables with some primary and foreign keys (i.e., no views, stored procedures, functions, etc.). I'd like to do all joins, grouping, sorting, and advanced data manipulation using Linq.
I have experience with LinqToO...
I have a typical object (it comes from Linq but it could have been create manually):
public class Person
{
public string FirstName{get; set;}
public string LastName{get; set;}
public int Age{get; set;}
}
And I have a Web Form where users enter this data:
<asp:TextBox runat="server" ID="FirstName"></asp:TextBox>
<asp:TextBox run...
I have a database that I cannot change the format of.
Custom objects are stored in a table called Custom_Independent that has several fields like text1,text2 and a app_name field that can be used as a distinguisher.
Any additional fields are store in a seperate table User_Fields, there is also a User_field_defs table that contains the ...
I'm new to LINQ, and I have trouble with a query I'm trying to write to teach myself LINQ.
I have a list of MyError objects.
A MyError object has a errorcode (an enum) and an arraylist of MyEntryError objects. Some MyError may have the same errorcode.
I would like to create a LINQ query that take as input my list of MyError and outputs...
Hello all - seasons greetings to you all. I really need some help as this is driving me mad.
The aim. I have a textbox which a client enters a number, they click on a radio button list to select a material and hit a button to populate a gridview.
This is the front end code:
<asp:TextBox ID="tbxHowMany" runat="server"
style="z...
Hello,
I am reading in from my web.sitemap file, and I would like to apply a Linq OrderBy command to the ChildNode elements. However, I can't seem to access the OrderBy method to the ChildNodes property unless I first cast it to SiteMapNode (which is dumb because it's already of type SiteMapNode). Please point me in the right direction...
I'm not entirely convinced of the benefits of a 3-tier architecture. Why, then, has LINQ emerged, which is a lighter data access approach? Any input would be appreciated.
...
Hi,
I'm thinking about using Linq to NHibernate in an upcoming project, so I'd like some feedback about it. I found this identical question asked in February, and it seemed that Linq to NHibernate was not very mature at this time... Has it improved since then ? Has anyone used it in real life applications ?
Thanks for your feedback
PS...