Skip to content

LINQ

LINQ (all flavours)

This category can be followed from the open social web via the handle linq-e04cf296@forum.codeproject.com

783 Topics 2.8k Posts
  • DAL issue

    csharp database linq design mcp
    7
    0 Votes
    7 Posts
    3 Views
    T
    Don't allow the ObjectContext to be created outside of the layer you wish it be used in. ? Tauseef A Khan MCP Dotnet framework 2.0.
  • lnq

    csharp linq question
    2
    0 Votes
    2 Posts
    2 Views
    A
    LINQ is Language Integrated Query. :-D Read this Basics of LINQ & Lamda Expressions[^] I hope you will get some concept from my article. :thumbsup: Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution. My Latest Articles-->** Simplify Code Using NDepend Basics of Bing Search API using .NET Microsoft Bing MAP using Javascript
  • Super Slow DeleteAllOnSubmit

    database debugging performance help question
    2
    0 Votes
    2 Posts
    1 Views
    A
    You are not doing it wrong. Linq is generating a delete statement for each row in the table and matches the row to delete on all columns. This is why it takes a lot of time. the ExecuteCommand is the prefered way in this scenario Andreas Johansson IT Professional at Office IT Partner i Norrbotten Sweden What we don't know. We learn. What you don't know. We teach
  • Error : Calling SSIS package from .Net

    help csharp sql-server design xml
    10
    0 Votes
    10 Posts
    2 Views
    V
    No that is not the Issue. But if you have both installed. They can both have SSIS installed on them . it will be installed in different directories. for sql 2010 it will create a Folder named "100"and inside this one it will have another named "Packages" and that is when you will have your packages after you install them. Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
  • Entity framework and database agnosticity??

    database csharp sql-server com sysadmin
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • hi i'm having problem with linq query datetime...

    database help csharp linq tutorial
    5
    0 Votes
    5 Posts
    3 Views
    J
    Sorry, I don't speak txtspk.
  • Insert without primary key

    csharp database linq
    5
    0 Votes
    5 Posts
    2 Views
    S
    Thanks Andreas,:) Its working fine. its good, we can set the primary key on the entity level not in the database. thanks, Sri...
  • 0 Votes
    5 Posts
    2 Views
    A
    First of all. converting a single object to an array just to collect the first element in the array. is pointless. so remove the lines: Array ab; ab = validity.ToArray(); TextBox4.Text = ab.GetValue(0).ToString(); I don't understand what you are trying to to. do you want to have the same text in TextBox4 as in TextBox2 ????? in that case: TextBox4.Text = validity.Select(s=>s.customer_lname).FirstOrDefault(); if you want the customerID in TextBox4: TextBox4.Text = validity.Select(s=>s.customer_ID).FirstOrDefault().ToString(); kind regards Andreas Johansson IT Professional at Office IT Partner i Norrbotten Sweden What we don't know. We learn. What you don't know. We teach
  • 0 Votes
    2 Posts
    1 Views
    A
    You mean autogenerate them using some wizard of VS Studio? :confused: dbml classes might help you in this regard.. I guess. Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution. My Latest Articles-->** Simplify Code Using NDepend Basics of Bing Search API using .NET Microsoft Bing MAP using Javascript
  • 0 Votes
    2 Posts
    1 Views
    N
    You need to rephrase the question. It makes no sense. Best wishes, Navaneeth
  • Hash Code Issue

    tutorial cryptography help question
    7
    0 Votes
    7 Posts
    3 Views
    L
    Thank you! That clarifies it :) "9 Pregnent woman can not have a baby in 1 month" -Uknown
  • LINQ oddity...

    csharp database wpf wcf linq
    3
    0 Votes
    3 Posts
    2 Views
    U
    You were right.   I had made a booboo previously in my datatables.   It works now.   :)
  • 0 Votes
    2 Posts
    2 Views
    _
    i have done it guys with expression. This article helped me http://social.msdn.microsoft.com/Forums/en-US/linqprojectgeneral/thread/8b8f766c-c7a2-4b29-a075-2db80a65a0fe/[^] i replaced the return statement to this ; System.Linq.Expressions.ParameterExpression paramExp = System.Linq.Expressions.Expression.Parameter(typeof(TEntity), "ParamExp"); System.Linq.Expressions.Expression<Func<TEntity, bool>> predicate = System.Linq.Expressions.Expression.Lambda<Func<TEntity, bool>>( System.Linq.Expressions.Expression.Equal( System.Linq.Expressions.Expression.Property(paramExp, pInfo), System.Linq.Expressions.Expression.Constant(PrimaryKey)), paramExp); return context.GetTable<TEntity>().Where(predicate).First();
  • 0 Votes
    2 Posts
    2 Views
    L
    Personally I like CE because I know very little about SQL butI can destroy and create CE databases fairly quickly, and LINQ seems to work well with it. Unfortunately a number of (very good) tutorials assume you have the MS Northwind database and Server 2008 already installed. I suspect that the thinking is that anyone using an SQL database is developing web sites or commercial apps so is more likley to need server 2008.
  • Convert SQL to Linq

    database csharp linq
    3
    0 Votes
    3 Posts
    2 Views
    R
    If you have defined the relationships in the data context (.dbml), linq has what i would say lazy loading intellisense which gives you a way to do complex query in a simple linq friendly way. Here is an example related to your query: using (dataContext db = new dataContest) { var q = from p in db.ProjectCatergories where p.ProjectCategoryDetails.ProjectContentInfoSamples.ProjectID == "Pr-09" select new { p.projectCategoryName }; } So basically linq joins the tables automatically and that is one of the reasons I believe linq is so powerful! Hope this helps!
  • 0 Votes
    6 Posts
    2 Views
    P
    hi friends, i had faced this problem and i found a temporary solution. Before u drag and drop your sp from .net server explorer to .dbml file just comment the body of SP and write only select statement without double quote and where condition. e.g. (in your case) select t.*, c.name as Cur_Country_Desc, b.name as Branch_Desc from entiretable t left join countries c on t.n_cur_country = c.code left join branches b on t.branch_code = b.code and make actual sp code comment and now drag and drop sp from .net server explorer to .dbml file, which will creates a class file with the SPName+"Result" in .designer.cs file which have all the fields. now just remove above code from your sp and make uncomment your actual code. now i hope this will work becouse i have tried. again remember it will return class that u can find in .designer.cs file with your SPName+"Result". Let me know u have any doubts. Regards, Tabrez Shaikh Software Developer tabrezshaikh11@gmail.com
  • Linq "Not In" sql Query

    database csharp linq help question
    4
    0 Votes
    4 Posts
    1 Views
    D
    You should refer to this[^] link. Quite useful if you are learning LINQ infact anytime it is quite useful. It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
  • 0 Votes
    1 Posts
    1 Views
    No one has replied
  • Cannot get LINQ statement to work

    csharp database linq help question
    4
    0 Votes
    4 Posts
    2 Views
    S
    As far as I know, the LINQ 'join' can only use one equality comparer. For complex joins you should use multiple 'from's. Example: from n in Logins from z in Topics where n.ID==z.ID && n != null select n
  • Linq2Sql: Adding an object with childs

    help csharp database linq
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied