views:

5

answers:

0

A small website I did for a friend about 6-7 years ago is no longer working because the host is now medium trust and the app reads in a schedule via a .csv and using oledb. Here is the code

string sConnectionString
= "Provider=Microsoft.JET.OLEDB.4.0;"
+ @"Data Source=" +
System.Web.HttpContext.Current.Request.PhysicalApplicationPath +
";Extended Properties=Text;";
OleDbConnection conn = new OleDbConnection(sConnectionString);
OleDbDataAdapter da = new OleDbDataAdapter("Select * FROM Schedule.txt", conn);
da.Fill(dsOld, "Schedule");

I just spent about 30 minutes (20 minutes more than I wanted to spend on this!) looking around and haven't found much except try a relative path (couldn't get this to work) or that OleDB doesn't work in medium trust and have to do something completley different.

So anyway is there a quick solution to change it so it now works in medium trust?

Thanks