I want to test out the LINQ in my Repository code:
public IEnumerable<InventoryItem> Get(string ID, string packSize, int CountToFetch)
{
return inventoryItems.Where(i => 0 < String.Compare(i.Id, ID)).Where(i => 0 < String.Compare(i.PackSize.ToString(), packSize)).Take(CountToFetch);
}
...and am trying to use LINQPad to do that.
The data comes from an MS Access database; seeing that LINQPad doesn't seem to support Access "out of the box" that way, I wonder if either there's a driver for that (couldn't fine one - don't have the DevExpress product needed to use their driver), or if I could query by attaching to my Web API Rest method inside LINQPad?
I tried the SQL Server driver, hoping that would work for Access, too; I tried the WCF driver, hoping maybe that would work with Web API, but neither worked; with the latter attempt, I got, "XmlException: Data at the root level is invalid. Line 1, position 1."
How to import REST API data to Access. In MS Access, go to External Data Ribbon and select New Data Source and select From Other Sources and ODBC Database. Select the Source and destination of the data, select Import the source data into a new table in the current database and press OK.
All of your team can use your Microsoft Access database online from anywhere in the world using any computer or device. It feels just like you are working on your own computer, but you are actually running your Microsoft Access database online in a secure cloud.
There is a 'Microsoft Access Data Context Driver' for LinqPad
You can download it here: MSAccessDataContextDriver.lpx
View a screenshot here: LinqPad Northwind.accdb
UPDATE (5 Nov 2014) The driver now supports password protected MS Access databases
Take a look at this LinqPad blog about how one person managed to connect and query MS Access.
how-to-connect-to-and-query-a-ms-access-database-mdb-and-accdb
One other possible solution is to use XPO persistent classes to connect to MS Access.
This topic describes how to install the driver and use it to query XPO persistent classes
LinqPad Data Context Drivers
There also might be a way to use the IQ Drivers. I am not sure if connections to MS Access have been added.
Hope this helps. Regards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With