I have another program that reads this spreasheet and processes it.ĭim sConnectionString As String = "Provider=.4.0 " + "Data Source=" + filnavn + " " + "Extended Properties=Excel 8.0 "ĭim objCon As OleDbConnection = New OleDbConnection(sConnectionString) I have generated an xml spreadsheet (*.xls) using XSL. GridView1.DataSource = ds.Tables.DefaultView Fill the DataSet from the data extracted from the worksheet. Create a DataSet which will hold the data extracted from the worksheet. OleDbDataAdapter oleda = new OleDbDataAdapter() OleDbCommand cmd = new OleDbCommand("SELECT * FROM. Create OleDbCommand object and select data from worksheet Sheet1 Throw new Exception("Unable to find sheet in the selected file.") If (oledbConn.State = ConnectionState.Open) OleDbConnection oledbConn = new OleDbConnection(connString) ĭataTable dtSheetName = oledbConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null) Protected void Page_Load(object sender, EventArgs e)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |