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=Microso开发者_高级运维ft.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.
精彩评论