|
|
Browse by Tags
-
Hello all, I have two tables with the same columns. I want to compare the two tables and only return the rows which have a different value in any of the columns and where a row exist in one table but not in the other. So in the result i want to leave out all the rows which have the same values in both tables for all columns. For example: table employee_VS name1 adres1 name2 adres2 name3 adres3 name4 adres8 table employee_Gb name1 adres1 name2 adres2 name4 adres4 (The two ' tables ' i get are a result Read More...
|
-
Hi I want to write a Correlated SubQuery in LINQ. Here is the scenario. I will Company ID as my paramater. I want to loop through each Customers for this Company ID. Then for each Customers I want to take the top 1 Product of it and manuplate the product feilds. This I want to write in a LINQ Query. Generally the LINQ Query will return the List/Collection. How to get only a single column. Bascially I want my Query should be like below var Errors = (from Proud in ctx.Products where Proud.CustomerId Read More...
|
-
I've got an application that's reading thousands of rows from a file and inserting them into a database. I'm updating my code to use LINQ (before I used the SQL classes and inserted one by one). However, from time to time, we get a record in the file that is already in the database. In this situation, when I call SubmitChanges(), I get a SqlException for trying to insert a duplicate key row. How can I tell which record it failed on, without having to call SubmitChanges() on every record? I saw another Read More...
|
-
A couple of weeks ago, I posted some code to use LINQ to query tables in an Excel spreadsheet . Because you can query databases using LINQ to SQL, you can write code to query a database and do a join with data in an Excel spreadsheet. This can enable some interesting scenarios – let’s say that you have a database that contains some sort of master records, and you’ve downloaded another table and significantly modified it through one means or another. Without using this technique, you would either Read More...
|
-
I have some LINQ to SQL that must use BETWEEN. To get all tours I use: var theseTours = from pr in db.PackageRegions where pr.regionID == RegionID && pr.Package.isVisible==true Now I want the LINQ to say ie. that pr.Package.name. BETWEEN(a,e) Any help? I have broken my search into groups of 5 letters(a-e, f-j.....) and depending on what group you click on I want to do the search. Thank you Sarel Read More...
|
-
I have some LINQ to SQL that must use StartsWith. To get all tours I use: var theseTours = from pr in db.PackageRegions where pr.regionID == RegionID && pr.Package.isVisible==true Now I want the LINQ to say ie. that pr.Package.name.StartsWith a, b, c, d or e Any help? I have broken my search into groups of 5 letters(a-e, f-j.....) and depending on what group you click on I want to do the search. Thank you Sarel Read More...
|
-
Hi, I am new to LINQ and I have been trying to do something pretty simple with a DB I am playing around with: There are 3 tables, User, UserToClub, and Club. UserToClub maps clubs to a given user and has the user's ID and the club's ID as FKs. When I generated EDMX for this DB I got two Entities - User and Club. I just want to filter clubs based on a given list of users, in this case based on a given city. The code compiles fine but I get a runtime error when I try to call Count on myClubs which Read More...
|
-
Hello, I have created an example project that uses 2 tables from NORTHWND database. In this project I want to implement LINQ caching together with LINQ paging functionality. Currently I am only capable of implementing these two functionalities separately. If the caching works then paging no longer works and vice versa. I need a solution on how to combine LINQ paging and LINQ caching functionality with an addition that as soon as any modifications are made to the database tables from which the data Read More...
|
-
The MSXML Team is pleased to announce that MSXML 4.0 Service Pack 3 (SP3) Beta is available for public testing. This new service pack includes a number of security bug fixes as well as reliability improvements. MSXML4 SP3 is a complete replacement of previous service packs. The new service pack includes: ² A number of security bug fixes which provides a safer browsing experience. ² Reliability improvements. MSXML 4 SP3 is a Download Center only release and is applicable to the following Windows Operation Read More...
|
-
As a newcomer to LINQ I am greatly intrigued by the possibilities, although still learning the dynamics. I have 2 queries written in LINQ: DataClassesDataContext dc = new DataClassesDataContext (); var debts = from rec in dc.OurRecords join xd in dc.ExcelDatas on new { rec.AccountNumber, rec.paidToUs, rec.dueToUs, rec.GST } equals new { AccountNumber = xd.Account, paidToUs = xd.Amount1, dueToUs = xd.Amount3, GST = xd.Amount4 } where (rec.ourDate.Value.CompareTo(xd.DateAgency.Value)>=0 && rec.ourDate.Value.CompareTo(xd.DateDirect.Value) Read More...
|
-
Office is a platform. When we combine the programmability of Office Clients (Word, Excel, PowerPoint, and Access) with the programmability of SharePoint to enable deep integration of data from Line-of-Business enterprise applications, we enable building an entirely new category of application. This blog post presents my thoughts and reflections on Office Business Applications. Acknowledgements: I’ve taken this information from a variety of sources, including Steve Fox, who is one of the experts in Read More...
|
-
How can I load treeview using LINQ to SQL. I have searched in google, but I couldn't find anything related to it. Currently I am using ds.relations to load the treeview. I want to display Parent Column,Child Column for treenode. How can I do this? Someone Plz help me. Hope I would get some ideas from here. Thanks, CBosco Read More...
|
-
The query here, is getting the first verse of all chapters from a book in a bible. SELECT First(t.textid) AS FirstOftextid, First(bookch.chapter) AS FirstOfchapter FROM bookchapter AS bookch INNER JOIN bookchapteralinea AS bca INNER JOIN [Text] AS t ON bca.bookchapteralineaid = t.BookChapterAlineaid AND bca.Alineaid = t.Alineaid ON bookch.bookchapterid = bca.bookchapterid WHERE t.bookeditionid=? GROUP BY bca.bookchapterid; In LINQ I could produce something like this (but no further). Who can help Read More...
|
-
I would appreciate some help on a query I am working on. I have a database such as the following: Apple Banana Strawberry Peach I would like to be able to allow the user to filter these items by starting alphabetical character. For example, I would like them to be able to select one of the following. a-e f-h i-k etc. How do I do that in linq? Here is what I have so far. Results = Results.Where(a => a.Name.StartsWith("a") ); But the problem is that the results only have those database items which Read More...
|
-
I need to create several xml files based on existing template. This is the xml that I'm having trouble with: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:model.xsd" > With the "xmlns:xsi" I've sucessful used the bellow code: XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance"); How can I write the xsi definition above (in red)? Thanks, Paulo Mello. Read More...
|
|
|
|