简体   繁体   中英

Does LinqToSql support text file connections?

I am having trouble getting a connection string initialized to 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've also tried 'providerName' and received the same error.

I wonder if this is masking an inability to support using Text files as connections. Can LinqToSql do what I want it to do? If so, can someone provide a working example of the string?

Thanks in advance.

LINQ To SQL supports only SQL Server as its target.

If you're looking for something like LINQ To Text File, try this article: LINQ To Text Files by Eric White. He's got sample code that you can modify for the layout of your text file.

LinqToSql only supports Microsoft SQL Server, and I think also the compact edition, but that's it.

The Entity Framework supports other database engines, but I'm not sure about text files, but LinqToSql won't do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM