As I am new to Linq and Entity Framework, I don't know how I add comma sepearted and left join in linq/Entity code. My Sql query is rather big and I want it to be convert in Linq/entity: Select DISTINCT SR.StudentRequestId,SR.RegistrationId,SR.Location,SR.PaymentMethod,SR.CreatedOn,C.ClassName,CC.CampusName, CASE WHEN ISNULL(TSR.StatusId,0)=0 THEN 1 ELSE TSR.StatusId END AS StatusId, substring( ( Select ', '+REPLACE(REPLACE(ST1.FromTime,'AM',''),'PM','')+'-'+ST1.ToTime AS [text()] From dbo.StudentRequestTimings ST1 Where ST1.StudentRequestId = SRT.StudentRequestId ORDER BY ST1.CreatedOn For XML PATH ('') ), 2, 1000) [Time] FROM StudentRequest SR Inner JOIN Registration R ON R.RegistrationId=SR.RegistrationId INNER JOIN Campus CC ON CC.CampusId=R.CampusId INNER JOIN Class C ON C.ClassId=SR.ClassId LEFT JOIN TutorClasses …

Member Avatar
Member Avatar
+0 forum 1

I have two tables, tblstudent having fields [studentId,rollNo,classId,studentName], tblclass having fields [classId, division,className]. The two tables are referenced by field classId. I want to fill tblstudent. Also I want the table tblClass should be filled at the same time. This is for creating reports. Can any one help me..

Member Avatar
Member Avatar
+0 forum 5

Hi friends., I am now try to study LINQ in C#.net which book can i refer and that is easy to learn and give perfect example code snippet

Member Avatar
Member Avatar
-1 forum 2

Hi, I am trying to define a 'null' LINQ Table as a global variable and then use a switch statement to deturmine what the Table should be. I am having problems defining the datatype and also assigning values to it. Hopefully the code below will explain better. [CODE] System.Data.Linq.Table table; switch (x) { case '1': table = DataClassesDataContext.Table_Name; break; case '2': table = DataClassesDataContext.Table_Name2; break; } [/CODE] Thanks for any help given

Member Avatar
Member Avatar
+0 forum 3

So I have this code so far to parse some values from many XML files. What I can't figure out is how to declare the folder that i need it to open. I need the code to open up a folder on my c:\ that has lots of xml files in it that it needs to parse, can someone help me alter my code to do that. It has to parse all the files in the folder. static void Main(string[] args) { XDocument doc = XDocument.Load(C:\Sciclone UAC\" ,"*.cfg"); //this i think is wrong var query = from x in doc.Descendants("XAxisCalib") …

Member Avatar
+0 forum 0

I haven't done any sort of development for a while, but what i'm looking for is to see a simple example of an ntier application using linq. Showing BLL, DAL with roles and membership. I'm also keen on getting better with my OOP and would like to find a site that has console type application exercises so I can practice. Thanking you in advance for your help.....and I hope I haven't asked for too much.

Member Avatar
Member Avatar
+0 forum 4

The main problem is that I recieve the following message: "base {System.SystemException} = {"Unable to create a constant value of type 'BokButik1.Models.Book-Author'. Only primitive types ('such as Int32, String, and Guid') are supported in this context."}" based on this LinQ code: [CODE] IBookRepository myIBookRepository = new BookRepository(); var allBooks = myIBookRepository.HamtaAllaBocker(); IBok_ForfattareRepository myIBok_ForfattareRepository = new Bok_ForfattareRepository(); var Book-Authors = myIBok_ForfattareRepository.HamtaAllaBok_ForfattareNummer(); var q = from booknn in allBooks join Book-Authornn in Book-Authors on booknn.BookID equals Book-Authornn.BookID select new { booknn.title, Book-AuthorID };[/CODE] [B]How shall I solve this problem to get a class instance that contain with property title and Book-AuthorID?[/B] // …

Member Avatar
Member Avatar
+0 forum 7

[CODE] private void displayWith1Criteria(string column, string value) { Console.WriteLine("entering _1_ display method"); dbcontent = new DBtestEntities(); var studienummerQuery = from members in dbcontent.Medlemmer.Include("Retninger") where column == value orderby members.Fornavn select new { Studienr = members.Studienummer, Fornavn = members.Fornavn, Efternavn = members.Efternavn, Email = members.Email, Studiested = members.Studiested, Betaling = members.BetalingsType, Uddannelses_Retning = members.Retninger.retningNavn }; dataGridView1.DataSource = studienummerQuery; } [/CODE] Doesnt return any data at all... column is being called with members.Fornavn (Fornavn = a column name) value = Anders (one of the data's in Fornavn column)

Member Avatar
Member Avatar
+0 forum 4

The End.