i am accesing an excel file from C# in MS visual studio 2005. the basic function is dome and working fine. the thing is i wanna parametrize the datasource, the follwong is the databse conncetion line:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\table.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
Instead of having Data Source=C:\table.xls, i need it to be c:\x
where x is the file name chosen from a drop down list. So if the user chooses google (string) from the dropdown list, the data source is then c:\google.xls
All excel files are already available in C:\.
Please help me implement this simple issue as it is vital to my final year project, else if it doesnt work i wont graduate this semester! i am in a bad situation here and i really appreciate anyhelp.
Attached is my project if needed. (am trying to display the first row of the selected excel file in a datagrid)
Thanks a lot
Attached File(s)
-
test.zip (854.23K)
Number of downloads: 192
This post has been edited by Martyr2: 05 April 2008 - 10:38 AM

New Topic/Question
Reply




MultiQuote





|