I have the following connection string:
provider=SQLNCLI11;Server=[server];Database=[db];uid=[uid];pwd=[pwd]
and I have the following code:
OleDbCommand oComm = new OleDbCommand();
oComm.Connection = OleConnection;
oComm.Transaction = m_oleTran;
oComm.CommandText = sSQL;
oComm.CommandTimeout = TimeOut;
BuildParams(ref oComm, sCols, (object [])oVals);
if (oComm.Connection.State == ConnectionState.Closed)
oComm.Connection.Open();
m_RowsAffected = oComm.ExecuteNonQuery();
if (m_oleTran == null)
oComm.Connection.Close();
oComm.Dispose();
private void BuildParams(ref OleDbCommand oComm, string [] sCols, object [] oVals)
{
for (int i = 0; i< sCols.Length; i++)
{
if (sCols.Length > 0)
oComm.Parameters.AddWithValue(sCols[i], oVals[i]);
}
}
when I executed a simple update SQL statement, I got the following error
The fractional part of the provided time value overflows the scale of the corresponding SQL Server parameter or column. Increase bScale in DBPARAMBINDINFO or column scale to correct this error. at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
Any ideas?
Thanks,