I'm trying to query an embedded resource file (csv text) with LINQ, but nothing I've tried has worked. Does anybody know how? My failed attempts are listed below:
1)
OleDbCommand cmd = new OleDbCommand(@"SELECT * FROM Application.Properties.Resources.PresidentialLifeSpansCSV", cn);
<-- At runtime, I get the err msg:"The Microsoft Jet database engine could not find the object 'Application.Properties.Resources.PresidentialLifeSpansCSV'. Make sure the object exists and that you spell its name and the path name correctly."
2) string[] csvText = Properties.Resources.PresidentialLifeSpansCSV.Split('\n'); //<- same err msg as above
3)
TextFile f = Properties.Resources.PresidentialLifeSpansCSV; <--I tried File and TextFile. Textfile gives me "The type or namespace name 'TextFile' could not be found (are you missing a using directive or an assembly reference?)" and File gives me "Cannot declare a variable of static type 'System.IO.File'"
OleDbCommand cmd = new OleDbCommand(@"SELECT * FROM csvText", cn);