Click here to Skip to main content
15,916,180 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have tried to read articles but most are just basic in nature. I created the sql statement below, but I may also have to modify it for linq, not sure.

Dim sqlconn1 As New SqlConnection("databasesource")
      Dim sqladaptor = New SqlDataAdapter

      sqlconn1.Open()
      sqladaptor.SelectCommand = New SqlCommand("Select Profile.Individual_ID, First_name, Middle_name, Last_name, Sex, Race, Place_of_birth, County_of_birth, State_of_birth, Date_of_birth, death.Death_ID, Place_of_death, State_of_death, County_of_death, Date_of_death, Cause_of_death, Cemetery_reference.Cemetery_ID, Cemetery_name, Cemetery_state, Cemetery_county, Cemetery_address, Cemetery_Section, Cemetery_Row, Cemetery_Lot, Grave, Burial_date from Profile full join Death On profile.Individual_ID = death.individual_ID full join Burial On Profile.Individual_ID = Burial.Individual_ID full join Cemetery_reference On Burial.Cemetery_ID = Cemetery_reference.Cemetery_ID ORDER BY Last_name ASC, First_name ASC, Date_of_birth ASC", sqlconn1)
      sqladaptor.SelectCommand.CommandTimeout = False
      sqladaptor.SelectCommand.ExecuteNonQuery()
      sqladaptor.Fill(dt)
      sqlconn1.Close()
      sqlconn1.Dispose()
      sqladaptor.Dispose()


What is the best approach for learning more complicated linq queries, and how can I turn what I already have into a linq query?

What I have tried:

I have read articles online but I could not figure out how to attempt a multi-table linq query from an sql statement.
Posted
Updated 1-Mar-23 21:51pm

1 solution

Hi try the below tool to convert it
https://www.linqpad.net/
http://www.sqltolinq.com/
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900