Click here to Skip to main content
15,117,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i insert data and retrive it from excel sheet ?

and if i retrived more than one result how can i split them ?

string Con_Str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FullName + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";";
                    OleDbConnection con = new OleDbConnection(Con_Str);

                    String qry = "SELECT * FROM [Sheet1$]";
                    OleDbDataAdapter odp = new OleDbDataAdapter(qry, con);
                    DataSet ds = new DataSet();

Here you can make the insert option also.
Prasanta_Prince 30-Apr-11 13:02pm
Its good to know that it helps you.

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