Linq sample code for ado.net - sql server?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Microsoft SQL Server
Post Reply
khanh
Posts: 3
Joined: Mon 13 Apr 2020 21:20

Linq sample code for ado.net - sql server?

Post by khanh » Mon 13 Apr 2020 21:28

I have a project vsto with sql server, and I want to use ado.net to read and write data to it because I want to create dynamic queries when using linq.
I am fairly new with sql and linq. I would like to ask if devart provide some basic code samples to access reading, writing even formula in the query (such a query string: "Select left(Column1,3) from Table1")

I mean I want to customize the query string more,
ex: get the header or not, support formula sum, average, etc. (if I'm using dotconnect for sql server then can I access these Canonical Functions? )

if they don't already exist and I have to build by myself whether I should choose devart linq to sql or entity framework? . Mostly my work is reporting but not too complicated, I will load all the data into sql database and customize the data to report through the query string.

Thank you!

khanh
Posts: 3
Joined: Mon 13 Apr 2020 21:20

Re: Linq sample code for ado.net - sql server?

Post by khanh » Tue 14 Apr 2020 02:33

I have just tested dotconnect for sqlserver, I would like to ask if I use the query multiple times, what should I do to improve performance, such as creating a virtual table or stored procedure, objectquery or querystring cache, ... I Not sure exactly what will help ?

Shalex
Site Admin
Posts: 8861
Joined: Thu 14 Aug 2008 12:44

Re: Linq sample code for ado.net - sql server?

Post by Shalex » Fri 17 Apr 2020 18:18

dotConnect for SQL Server doesn't support any ORM frameworks.

You can use a standard provider System.Data.SqlClient.

Our product line includes the following tools for SQL Server (choose any): We recommend you to use Entity Framework - EF6 (Devart Entity Model, *.edml) or EF Core 3 (Devart EF Core Model, *.efml). After the code is generated by Entity Developer, refer to Microsoft documentation for the use case samples.

khanh
Posts: 3
Joined: Mon 13 Apr 2020 21:20

Re: Linq sample code for ado.net - sql server?

Post by khanh » Sat 25 Apr 2020 10:44

Thanks shalex, i got it.

Post Reply