Rectangle 27 6

Neither yet supports the unique SQL 2008 datatypes. The difference from my perspective is that Entity still has a chance to construct a model around my geographic datatype in some future release, and Linq to SQL, being abandoned, never will.

SQL Server 2008 Spatial datatypes (Open Geospatial Consortium OGS) supported as of Entity Framework 5. Other providers (Devart for Oracle) also supported. See msdn.microsoft.com/en-us/data/dn194325 .

.net - Entity Framework vs LINQ to SQL - Stack Overflow

.net entity-framework linq-to-sql
Rectangle 27 6

Neither yet supports the unique SQL 2008 datatypes. The difference from my perspective is that Entity still has a chance to construct a model around my geographic datatype in some future release, and Linq to SQL, being abandoned, never will.

SQL Server 2008 Spatial datatypes (Open Geospatial Consortium OGS) supported as of Entity Framework 5. Other providers (Devart for Oracle) also supported. See msdn.microsoft.com/en-us/data/dn194325 .

.net - Entity Framework vs LINQ to SQL - Stack Overflow

.net entity-framework linq-to-sql
Rectangle 27 3

It has Enumerable's LINQ to Objects extensions like stuffs. But for more complicated LINQ things like Expression and ExpressionTree (these are needed for LINQ to SQL and other LINQ providers if they want provide something optimized and real), there is not any equivalent yet but maybe we will see that in future :)

What is the Java equivalent for LINQ? - Stack Overflow

java linq
Rectangle 27 0

For our application I plan on using LINQ to Entities, but as it's new to me there is the possiblity that I will want to replace this in the future if it doesn't perform as I would like and use something else like LINQ to SQL or NHibernate, so I'll be abstracting the data access objects into an abstract factory so that the implementation is hidden from the applicaiton.

How you do it is up to you, as long as you choose a proven and well know design pattern for implementation I think your final product will be well supported and robust.

c# - What's the best way to set up data access for an ASP.NET MVC proj...

c# asp.net asp.net-mvc visual-studio visual-studio-2008
Rectangle 27 0

For any future desperate programmer, I had to update the linq data source code on the updated event:

protected void ldsCampaigns_Updated(object sender, LinqDataSourceStatusEventArgs e)
    {
        using (DashboardDataContext c = new DashboardDataContext())
        {
            Label Label3 = gvManager.Rows[gvManager.EditIndex].FindControl("Label4") as Label;

            List<CMSCampaigns> change = c.CMSCampaigns.Where(s => s.ContentID == Convert.ToInt16(Label3.Text)).ToList();

            DropDownList DropDownList2 = gvDashboardManager.Rows[gvDashboardManager.EditIndex].FindControl("DropDownList2") as DropDownList;


            change[0].DataColumn = DropDownList2.SelectedValue.ToString();

            c.SubmitChanges();
        }
    }

This is the clusteriest clusterkludge I've ever kludgestergrammed.

c# - One-way databind gridview - Update only? - Stack Overflow

c# asp.net data-binding gridview
Rectangle 27 0

As I understand it, support for LINQ to SQL isn't going anywhere, but most of the resources for ongoing development will be devoted to LINQ to Entities. I think you're safe going whichever direction looks like the better choice. If it's LINQ to SQL, go for it as long as it has everything you need- don't count on new features.

.net - Future of Linq to Sql and Entity Framework - Stack Overflow

.net linq-to-sql entity-framework
Rectangle 27 0

You should try PLINQO (http://www.plinqo.com). It's LINQ to SQL with a TON of improvements. Maybe someday EF will not suck. :-)

.net - Future of Linq to Sql and Entity Framework - Stack Overflow

.net linq-to-sql entity-framework
Rectangle 27 0

If it's a situation where either would work (which excludes the anonymous type situation), I try to use whatever will make the code easier to understand in the future. Sometimes that means using var if the usage scope is small or the type being assigned to is unwieldy (e.g., somekind of nested generic) to repeat and adds clutter. I also tend to use var where most people expect to see (e.g. as the declaration of a linq query).

c# - How do you use the var keyword? - Stack Overflow

c# c#-3.0
Rectangle 27 0

Completed the question with input from the previous answer. This is just to show you how to get the desired result if anyone searches for this in the future. This is created to be opened in Office Excel. So Linq To XML exported to an .xml file to be able to be opened in Excel easily.

<?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<ss:Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet">
  <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office" />
  <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel" />
  <ss:Worksheet ss:Name="Sheet 1">
    <ss:Table>
      <ss:Row>
        <ss:Cell>
          <ss:Data ss:Type="String">name</ss:Data>
        </ss:Cell>
        <ss:Cell>
          <ss:Data ss:Type="String">sku</ss:Data>
        </ss:Cell>
      </ss:Row>
      <ss:Row>
        <ss:Cell>
          <ss:Data ss:Type="String">Suunto Elementum Terra</ss:Data>
        </ss:Cell>
        <ss:Cell>
          <ss:Data ss:Type="String">SS014522000</ss:Data>
        </ss:Cell>
      </ss:Row>
    </ss:Table>
  </ss:Worksheet>
</ss:Workbook>
// Linq to XML - Namespaces
XNamespace ns = "urn:schemas-microsoft-com:office:spreadsheet";
XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance";
XNamespace x = "urn:schemas-microsoft-com:office:excel";
XNamespace x2 = "http://schemas.microsoft.com/office/excel/2003/xml";
XNamespace ss = "urn:schemas-microsoft-com:office:spreadsheet";
XNamespace o = "urn:schemas-microsoft-com:office:office";
XNamespace html = "http://www.w3.org/TR/REC-html40";
XNamespace c = "urn:schemas-microsoft-com:office:component:spreadsheet";

// Linq to XML - Document
XDocument doc = new XDocument(
    new XDeclaration("1.0", "UTF-8", string.Empty),
    new XProcessingInstruction("mso-application", "progid=\"Excel.Sheet\""),
    new XElement(ns + "Workbook",
        new XAttribute("xmlns", ns.NamespaceName),
        new XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName),
        new XAttribute(XNamespace.Xmlns + "x", x.NamespaceName),
        new XAttribute(XNamespace.Xmlns + "x2", x2.NamespaceName),
        new XAttribute(XNamespace.Xmlns + "ss", ss.NamespaceName),
        new XAttribute(XNamespace.Xmlns + "o", o.NamespaceName),
        new XAttribute(XNamespace.Xmlns + "html", html.NamespaceName),
        new XAttribute(XNamespace.Xmlns + "c", c.NamespaceName),
        new XElement(o + "OfficeDocumentSettings",
            new XAttribute("xmlns", o.NamespaceName)),
        new XElement(x + "ExcelWorkbook",
            new XAttribute("xmlns", x.NamespaceName)),
        new XElement("Worksheet",
            new XAttribute(ss + "Name", "Sheet 1"),
            new XElement("Table", // 1st Table
                new XElement("Row", // First Row
                    new XElement("Cell", // First Cell on First Row
                        new XElement("Data", new XAttribute(ss + "Type", "String"), "name") // Data in Cell A1
                    ),
                    new XElement("Cell",
                        new XElement("Data", new XAttribute(ss + "Type", "String"), "age") // Data in Cell B1
                    )
                )
            )
        )
    )
);
// Loop through a collection. Each iteration is a new row
foreach (Product product in products)
{
    // Linq to XML - Data
    doc.Descendants("Row").First().AddAfterSelf(
        new XElement("Row",
            new XElement("Cell",
                new XElement("Data", new XAttribute(ss + "Type", "String"), product.Name)), // Data in Cell A2
            new XElement("Cell",
                new XElement("Data", new XAttribute(ss + "Type", "String"), product.Age) // Data in Cell B2
            )
        )
    );
}
// Namespace fix. Deletes any empty xmlns="" text in every node.
foreach (XElement e in doc.Root.DescendantsAndSelf())
{ 
    if (e.Name.Namespace == string.Empty) 
    {
        e.Name = ns + e.Name.LocalName;
    } 
}

When I do this I get <Worksheet ss:Name="Sheet 1" xmlns=""> - note the blank xmlns - this stops excel from opening it

c# - Create Office Excel Doc with Linq to XML, XMLNS, XDeclaration, Ce...

c# .net excel linq-to-xml ms-office
Rectangle 27 0

I think if you are using LINQ TO SQL and you only modified the table on the database end without updating the LINQ TO SQL model than I believe you would be fine and nothing would break since the model object were not changed and structure is still the same although if you decide to update the LINQ TO SQL or select a non existed entity on your database it most likely going to throw you an inner exception. Ofcoust the most proper way to do it is to constantly keep the LINQ TO SQL model and the database be the same this way you will avoid a lot of future problems. if you add a nulable column to dbml but you are not using it in you project it should be fine as long as you are not updating it from your Linq to sql since if you do that you got to include it in your model

.net - Will LINQ-to-SQL break if I modify underlying tables? - Stack O...

.net sql-server linq linq-to-sql
Rectangle 27 0

For easy access to database data from code you should use ORM. Most simple one is Linq to SQL as akash88 have mentioned. If you need only simple operation as reading from specified table it would be best choice. But if in future there would be more complicated task you should use either NHibernate or Entity Framework

Access SQL Server database with c# in WPF? - Stack Overflow

c# wpf sql-server
Rectangle 27 0

Just as an update, here are some links on the future of LINQ to SQL:

As a comment in the last link states, LINQ to SQL isn't going to go away, just not "improved upon" at least by Microsoft. Take these comments and posts as you will, just be cautious in your development plans.

What are the advantages of LINQ to SQL? - Stack Overflow

linq linq-to-sql stored-procedures ado.net
Rectangle 27 0

Entity Framework is an O/R mapper which is built on top of ADO.NET. LINQ to SQL is another alternative O/R mapping approach, but as far as I know, Microsoft goes for Entity Framework in future rather than LINQ to SQL.

Yes, 3.5 SP1 - but in EF 4 they fixed and improved lots of things that were cumbersome in 3.5 SP1 (auto pluralization of entities, foreign key fields, ...). I haven't migrated yet, so I cannot tell you in detail.

c# - ADO .NET, Entity Framework and LINQ to SQL - I got confused - Sta...

c# linq-to-sql entity-framework ado.net
Rectangle 27 0

There's a stackoverflow post here that talks about the differences between the two.

What's interesting is that Zack Peterson's answer where he posted a link to article which posses the question "Is Linq to SQL truly dead?" Good fyi article.

But if you're after an ORM, have you looked at NHibernate or SubSonic? There are definately a few good non-MS ORMs out there.

.net - Future of Linq to Sql and Entity Framework - Stack Overflow

.net linq-to-sql entity-framework
Rectangle 27 0

Neither yet supports the unique SQL 2008 datatypes. The difference from my perspective is that Entity still has a chance to construct a model around my geographic datatype in some future release, and Linq to SQL, being abandoned, never will.

SQL Server 2008 Spatial datatypes (Open Geospatial Consortium OGS) supported as of Entity Framework 5. Other providers (Devart for Oracle) also supported. See msdn.microsoft.com/en-us/data/dn194325 .

.net - Entity Framework vs LINQ to SQL - Stack Overflow

.net entity-framework linq-to-sql
Rectangle 27 0

For a feature branch, name it after what is being done. For example, I moved our ORM from LINQ to SQL to NHibernate and created a branch called "NHibernate". Once you have completed the branch and merged it back into the trunk you can delete the branch to save naming conflicts in the future. If you really need to retrieve the branch you can, you just have to delve back into the history and restore it.

If you have story/quote/job numbers that are relevant to a branch, I would append it to the name of the branch eg. "NHibernate_429" so you can easily reference it against your tracking system. However, I would always go with the English first as that's what people are more realistically going to refer to it by when it is in development.

For things like tags it's hard to say what you want to do as it depends on what it is you are tagging. If you are tagging releases then I would use "Release X.X.X.X" or something simple like that. You really aren't going to care what the date or build number was when you are looking back for a specific release as an example.

Which naming conventions do you use for SVN Branches and Tags? - Stack...

svn naming-conventions
Rectangle 27 0

I know it's late, but maybe someone else can make use of it in the future. You can achieve what you need using LINQ:

Dictionary<TestEnum, Int32> data = new Dictionary<TestEnum, Int32>();

data.Add(TestEnum.A, 1);
data.Add(TestEnum.B, 2);
data.Add(TestEnum.C, 3);

JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, Int32> dataToSerialize = data.Keys.ToDictionary(p => p.ToString(), p => data[p]);
string dataSerialized = serializer.Serialize(dataToSerialize);

c# - Problems with Json Serialize Dictionary - Stack Over...

c# json serialization dictionary
Rectangle 27 0

What about the future of LINQ to SQL?

If you are looking for the oldest date (minimum value), you'd sort and then take the first item returned. Sorry for the C#:

var min = myData.OrderBy( cv => cv.Date1 ).First();

The above will return the entire object. If you just want the date returned:

var min = myData.Min( cv => cv.Date1 );

Regarding which direction to go, re: Linq to Sql vs Linq to Entities, there really isn't much choice these days. Linq to Sql is no longer being developed; Linq to Entities (Entity Framework) is the recommended path by Microsoft these days.

It's not a secret that LINQ to SQL is included in the Framework 4.0 for compatibility reasons. Microsoft has clearly stated that Entity Framework is the recommended technology for data access. In the future it will be strongly improved and tightly integrated with other technologies while LINQ to SQL will only be maintained and little evolved.

@Metro Smurf That will not work because I want to test on multiple date columns in the same table. I will end up with too many sorts.

@Metro Smurf Thanks for the advise on EF4. Is there syntax difference is putting the Linq-to-SQL or Linq-to-Entities query?

@Erwin1 - please update your question to reflect what you are trying to achieve, re: the question doesn't mention anything about multiple columns. Regarding EF4 vs Linq to Sql syntax differences, I really don't know as I've never used Linq to Sql; but, I'm gonna go out on a limb and say yes, there will be quite a bit of syntax differences.

@Metro Smurf I have updated my question, I hope that you can help. In VB I do not have access to Lambda's.

Are you returning multiple rows back from the database or just a single row?

How to Select Min and Max date values in Linq Query - Stack Overflow

linq linq-to-sql
Rectangle 27 0

Neither yet supports the unique SQL 2008 datatypes. The difference from my perspective is that Entity still has a chance to construct a model around my geographic datatype in some future release, and Linq to SQL, being abandoned, never will.

SQL Server 2008 Spatial datatypes (Open Geospatial Consortium OGS) supported as of Entity Framework 5. Other providers (Devart for Oracle) also supported. See msdn.microsoft.com/en-us/data/dn194325 .

.net - Entity Framework vs LINQ to SQL - Stack Overflow

.net entity-framework linq-to-sql
Rectangle 27 0

I am quite sold on the priciples of Linq to Entities, and the Entity Framework in general, but I do have reservations about its current incarnation. I do freely admit to not having used it in anything more than a self-educational and very small way, though. The level of flexibility doesn't seem to be there yet but I'm sure it will come. I was told by one of the MS technology evangelists (great job title) that EF was the MS strategic choice for the future. Assuming this is the case, I can only see things getting better in this arena.

Why all the Linq To Entities Hate? - Stack Overflow

linq-to-entities