Multiple insert query using linq

Hi Team,

Please find attached insert queries. Please provide solution for how we can use these two insert queries in one linq query

tmp4.txt (22.8 KB)
tmp5.txt (22.8 KB)

Thanks in advance.

Hi All,

Please help above query.

Thanks in advance

From: c# - convert sql to linq - Stack Overflow:

One of good tool to convert SQL to Linq : Linqer

Try out this query

var q = (from r in Room 
            join v in Reservation on r.RoomID equals v.RoomID  into outer
            from o in outer.DefaultIfEmpty()
            where !(o.Date_Check_Out<= startdate || o.Date_Check_In>=endDate)
                  && v.cancel == 0 && v.ReservationID == null 
            select r);

Also check this :

See SQL to LINQ Tool existing thread.

If you decide to do it by hand, Linqpad should be useful.

You also like to see : SQL to LINQ ( Visual Representation ) some good exaple by graphical representation…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.