SQLNCLI11提供程序的错误是提供的时间值的小数部分溢出

时间:2017-11-07 09:43:34

标签: sql-server sqlncli

我有以下连接字符串:

provider=SQLNCLI11;Server=[server];Database=[db];uid=[uid];pwd=[pwd]

我有以下代码:

                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]);
        }
    }

当我执行一个简单的更新SQL语句时,我收到以下错误

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()

有什么想法吗?

谢谢,

0 个答案:

没有答案