I work in visual studio 2015 using c# windows form
I create excel file 2007 using xlsx with more sheets but
i need to return messagebox success tell me that file created
So that how to return message box success that show after file excel created ?
mycode
- public void CreateSheetIfNotExistsmemberAR()
- {
- using (System.Data.OleDb.OleDbConnection databaseConnection = new System.Data.OleDb.OleDbConnection())
- {
-
- DataTable schemaTable = default(DataTable);
-
- var fileName = string.Format("{0}\\Book3105", Directory.GetCurrentDirectory());
- var connection = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source={0};Mode=ReadWrite;Extended Properties=Excel 12.0 Xml;", fileName);
-
- databaseConnection.ConnectionString = connection;
- databaseConnection.Open();
-
- schemaTable = databaseConnection.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] {
- null,
- null,
- "Sheet3$"
- });
-
- if (schemaTable.Rows.Count == 0)
- {
- string SQLDDLCommand = "CREATE TABLE [Sheet3] (MemberID INTEGER, MemberName NCHAR(255))";
- System.Data.OleDb.OleDbCommand excelCommand = new System.Data.OleDb.OleDbCommand(SQLDDLCommand, databaseConnection);
- excelCommand.ExecuteNonQuery();
-
- }
-
- databaseConnection.Close();
- }
- }