c# - SQL to Linq equivalent -


I've got a stored procedure that I LINQ to SQL would, but I have some trouble because I LINQ the new (and in fact, I am not a SQL Guru) and I am not getting the desired result (I tried calling sproc with LINQ to SQL, but when I send in term dates as parameters sproc About getting the parameter to be on L2S Receives some error, but I also sent non-futile and I still get the same error.) Below is SQL:

  Select Persons.IDPerson, Persons.Name, Persons.PaternalName, Departments.DepartmentName, Jobs.Title, Persons.HireDate, Terminations.TerminationDate, Terminations.HireDate individuals Persons.IDPerson = left Terminations.IDPerson end joining outer left external Departments.idDepartment = Persons.IdDepartment Joining the departments on the outer left jobs.IDJob = joining Jobs at Persons.IDJob (Termin Ations.IDTermination is empty or Terminations.TerminationDate & gt; = @Pieriod) and Terminations.HireDate & lt; = @Period or Persons.HireDate & lt; = @ Term orders Persons.HireDate, Terminations.HireDate ASC by  

This is my LINQ code so far (this compilation, but it does not give me t he record I hope) Criteria.Period A tap datetime is:

  results = HRSystemDB.Persons.OfType & lt from employment; Employee & gt; () HRSystemDB.Terminations in the period when emp.IDPerson is equal to Term.IDPerson all in one diameter Where (t => (TIDITICATION == faucet || T. expiration date; Date & date = criterion duration.value.det) & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; टी.उ.डेटडेट Value.डेट & lt ; = Criteria.Pieriod.Value.Date || choose emp.HireDate.Date & lt; = Criteria.Period.Value.Date) .DefaultIfEmpty () new DepartmentHeadCountQuery {FullName = emp.Name + "" + emp.PaternalName, department = emp.Department.DepartmentName, JobTitle = emp.Job title, Trmtait = Air, expiration date, Iharddet = emp.HireDate, TermHireDate = aHire.TerminationDate};  

Thanks in advance.

This can be useful (for free trial):

  • LINQer is a SQL for LINQ converter tool.
  • This will help you learn LINQ and change your existing SQL statement.
  • Each SQL statement can not be converted to LINQ, but Linqer includes many different types of SQL expressions.
  • Linqer supports both .NET languages ​​C # and Visual Basic.
  • and completely free tools:

    • LINQPad is also a great way to learn LINQ: Comes before 200 examples from the 3.0 book. There is no better way to experience the coolness of LINQ and functional programming.

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -