Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string cad = @" Provider=Microsoft.ACE.OLEDB.12.0;" +
- @"Data Source=" +
- Server.MapPath("~/SVG/" + filenameexport + ".xlsx;") +
- @"Extended Properties=" + '"' + "Excel 12.0 Xml;HDR=NO" + '"';
- try
- {
- using (OleDbConnection con = new OleDbConnection(cad))
- {
- con.Open();
- string query = @"UPDATE [Cost Planning$] SET F9= ? WHERE F1 = 'Category'";
- using (OleDbCommand cmd = new OleDbCommand(query, con))
- {
- cmd.Parameters.AddWithValue("@param1", Convert.ToDateTime("2014/07/01"));
- cmd.ExecuteNonQuery();
- }
- con.Close();
- }
- }
- ((Excel.Range)worksheetobject.Range("A1")).EntireColumn.NumberFormat = "MM/DD/YYYY";
- ((Excel.Range)worksheetobject.Range("A1")).EntireColumn.NumberFormat = "MM/DD/YYYY";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement