M
Mike P
I'm trying to take some data from an Excel spreadsheet, put it into a
dataset, and then update a SQL table with the data. I'm not 100% sure
I'm doing this right, can somebody tell me what I'm doing wrong? The
error I'm getting is 'uninstallable ISAM', so I think the error is to do
with the connection string.
OleDbConnection connEx = new
OleDbConnection(ConfigurationSettings.AppSettings["connectExcel"]);
SqlConnection connSql = new
SqlConnection(ConfigurationSettings.AppSettings["connectBrdsql"]);
OleDbCommand commEx = new OleDbCommand("Select orderID, orderDate,
sos, refNo from [Dummy 1$], connEx");
OleDbDataAdapter dapEx = new OleDbDataAdapter(commEx);
DataSet dsSql = new DataSet();
connEx.Open();
connSql.Open();
dapEx.Fill(dsSql, "Orders");
SqlDataAdapter dapSql = new SqlDataAdapter("select * from
O2_B2B_Offline_Microsite_Staging", connSql);
dapSql.Update(dsSql);
Connection string :
<appSettings>
<add key="connectExcel" value="Provider=Microsoft.Jet.OLEDB.4.0; data
source=c:\orders.xls;Extended Properties=Excel 9.0"/>
<add key="connectBrdsql"
value="server=brdsql;uid=datawriter;pwd=rover9;database=amcat_relational
"/>
</appSettings>
Any help would be really appreciated.
Cheers,
Mike
dataset, and then update a SQL table with the data. I'm not 100% sure
I'm doing this right, can somebody tell me what I'm doing wrong? The
error I'm getting is 'uninstallable ISAM', so I think the error is to do
with the connection string.
OleDbConnection connEx = new
OleDbConnection(ConfigurationSettings.AppSettings["connectExcel"]);
SqlConnection connSql = new
SqlConnection(ConfigurationSettings.AppSettings["connectBrdsql"]);
OleDbCommand commEx = new OleDbCommand("Select orderID, orderDate,
sos, refNo from [Dummy 1$], connEx");
OleDbDataAdapter dapEx = new OleDbDataAdapter(commEx);
DataSet dsSql = new DataSet();
connEx.Open();
connSql.Open();
dapEx.Fill(dsSql, "Orders");
SqlDataAdapter dapSql = new SqlDataAdapter("select * from
O2_B2B_Offline_Microsite_Staging", connSql);
dapSql.Update(dsSql);
Connection string :
<appSettings>
<add key="connectExcel" value="Provider=Microsoft.Jet.OLEDB.4.0; data
source=c:\orders.xls;Extended Properties=Excel 9.0"/>
<add key="connectBrdsql"
value="server=brdsql;uid=datawriter;pwd=rover9;database=amcat_relational
"/>
</appSettings>
Any help would be really appreciated.
Cheers,
Mike