Click here to Skip to main content
14,695,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello i am writing a application with backend mysql5.0
i have a .xlsx file which i have to upload and read the data into mysql table.

Any one have any simalar code.

i had tried code-

string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                                                       "Data Source=" + Path + ";" +
                                                       "Extended Properties=\"Excel 12.0 Xml;HDR=YES\"";
            using (OleDbConnection cn = new OleDbConnection(ConnectionString))

DataTable dbSchema = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (dbSchema == null || dbSchema.Rows.Count < 1)

but i throughs an exception like Could not find installable ISAM..
Any suggestion !!
Updated 21-Oct-12 22:24pm

please download the files from
"" and install it.
try this,
if (hdnImageValues.Value != "")
               string filePath = @"D:\Images\" + hdnImageValues.Value;
               string fileName = hdnImageValues.Value;

               if (File.Exists(filePath))

                   FileStream fs = File.Open(filePath, FileMode.Open);

                   byte[] fsbyte = null;

                   fsbyte = new byte[fs.Length];

                   fs.Read(fsbyte, 0, Convert.ToInt32(fs.Length, null));

             Response.AddHeader("contentdisposition","attachment;filename=" + fileName);





This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900