输入字符串格式不正确SQL

时间:2015-04-07 22:55:58

标签: c# sql asp.net

我正在尝试使用SQL语句更新用户信息,并收到以下错误。

  

输入字符串的格式不正确。

CODE

public void UpdateDetails(string City, string State, string FvLng, string LstFvLng, string prgmComplDate, int customerID)
{
        dbConnection.Open();
        string sqlStmt = "UPDATE tblDetails SET City = @city," + "State =@state, "+" FvLng =@fvLng," + " LstFvLng =@lstFvLng, " +  " prgmComplDate = @prgmComplDate " + "  WHERE (tblDetails.CustomerID =@customerid)";
        OleDbCommand dbCommand = new OleDbCommand(sqlStmt, dbConnection);
        OleDbParameter param = new OleDbParameter("@city", City);
        dbCommand.Parameters.Add(param);
        dbCommand.Parameters.Add(new OleDbParameter("@state", State));
        dbCommand.Parameters.Add(new OleDbParameter("@fvLng", FvLng));
        dbCommand.Parameters.Add(new OleDbParameter("@lstFvLng", LstFvLng));
        dbCommand.Parameters.Add(new OleDbParameter("@prgmComplDate", prgmComplDate));
        dbCommand.Parameters.Add(new OleDbParameter("@customerid", customerID));
        dbCommand.ExecuteNonQuery();
        dbConnection.Close();
}

0 个答案:

没有答案