From what I can gather, ADO or ASP.net is not saving the Excel spreadsheet. Does anyone have any ideas on how I can remedy this? I have to use ADO, because my Web host will not install Microsoft Office on a shared server... :-( My code is as follows:
public void UpdateVelocity (String velocity) { // Create connection string variable. Modify the "Data Source" // parameter as appropriate for your environment.
String sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=c:\\WebSites\\MACE\\db\\ballistics.xls;" +
"Extended Properties=\'Excel 8.0;HDR=Yes;IMEX=2\'";
// Create connection object by using the preceding connection string.OleDbConnection objConn =
new OleDbConnection(sConnectionString); // Open connection with the database.objConn.Open();
//Create update command and executeOleDbCommand objCmdUpdate =
new OleDbCommand("UPDATE Info SET INFO = " +velocity+ " WHERE INDEX = 'Vol'", objConn);objCmdUpdate.ExecuteNonQuery();
// Clean up objects.objConn.Close();
}
Replies
Know the answer? Post it — somebody with the same question will find it here.