OleDbDataAdapter adp = new OleDbDataAdapter(oconn) OleDbCommand oconn = new OleDbCommand( "select * from ", cnn) Display Sheet Name, you can comment it out // MessageBox.Show(sheetname) //Load the DataTable with Sheet Data OleDbConnection cnn = new OleDbConnection(ConStr) ĭataTable dtSheet = cnn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null) įoreach (DataRow drSheet in dtSheet.Rows) Get one Book(Excel file at a time) foreach (FileInfo file in files)įileFullPath = SourceFolderPath+ "\\"+file.Name įilename = (".xlsx "," ") ĬonStr = "Provider=.12.0 Data Source= " + fileFullPath + " Extended Properties=\ "Excel 12.0 HDR=" + HDR + " IMEX=0\"" Declare and initilize variables string fileFullPath = "" Var directory = new DirectoryInfo(SourceFolderPath)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |