How to import data from Microsoft Excel 2010 to Gridview
am using web application.(visual studio 2010)
String strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=D:\\Book1.xls;" + "Extended Properties=Excel 8.0;HDR=NO;";
DataTable ds = new DataTable();
string strSQL = "SELECT * FROM [Sheet1$]";
OleDbDataAdapter da = new OleDbDataAdapter(strSQL, strConn);
da.Fill(ds);
grvPatient.DataSource = ds;
grvPatient.DataBind();
m trying like this it provide error
m trying like this it provide error
Mahesh ChandPosted Aug 11, 2011, 8:05 AM
Vilas GitePosted Aug 11, 2011, 7:39 AM
Hi aNJU.
REFER THIS ONE:
http://www.dotnetspider.com/resources/15076-Import-Excel-Sheet-Data-To-Data-Grid-View.aspx
Thanks.
-------------------------------------------------------------------------------
If this reply helps your post…then check "This is correct answer"
Jiteendra SampathiraoPosted Aug 11, 2011, 3:56 AM
refer our recommended articles....
refer this LINK1 and LINK2 also
Dorababu MekaPosted Aug 11, 2011, 3:26 AM