Does LinqToSql support connecting to a text file?

I'm having trouble getting the connection string initialized by a text file when using LinqToSQL.

I am trying to create a DataContext using the following connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\dat\;Extended Properties=text;HDR=Yes;FMT=Delimited 

I keep getting errors that the "Keyword Provider is not supported." I also tried 'providerName' and got the same error.

I wonder if this disguises the inability to support the use of text files as connections. Can LinqToSql do what I want? If so, can anyone provide a working example string?

Thanks in advance.

+4
source share
2 answers

LINQ To SQL only supports SQL Server as its target.

If you are looking for something like LINQ To Text File, try this article: LINQ To Text Files by Eric White. He got a sample code that you can modify to layout your text file.

+4
source

LinqToSql only supports Microsoft SQL Server, and I think this is a compact edition, but it is.

Entity Framework supports other database engines, but I'm not sure about text files, but LinqToSql will not.

+1
source

Source: https://habr.com/ru/post/1344315/


All Articles