0

大家好,我之前发布了一个关于如何设置有效合同以起草的问题,但我的研究发现它既可以直接进入 SQL 进行更新,也可以通过复制合同然后进行更新来完成。我不得不选择选项一。我正在尝试访问我的数据库并更新表,但从插件中得到一个 SQL 通用错误。我从插件访问数据库的代码(我通常使用实体框架连接):

string strConn = "Data Source=serverName;Initial Catalog=DatabaseName;IntegratedSecurity=SSPI";

SqlConnection connection = new SqlConnection();
SqlCommand command = new SqlCommand();
connection.ConnectionString = strConn;
connection.Open();
command.Connection = connection;
command.CommandText = "Update ContractBase set StateCode = 0,StatusCode = 1 "
  + "where ContractId = ACC70D43-DEBA-E111-8610-00155D041E80";
command.ExecuteNonQuery();
connection.Close();  

当我从插件连接到数据库时,还有什么需要考虑的吗?提前致谢。

4

2 回答 2

0

I am not sure if this is too late but you can create a SSIS package that stores CRM data in to SQL table. Create a simple plugin that on create or update fires of this SSIS package.

You will have to run this plugin with none isolation mode as the sandbox isolation will not allow file access (package).

于 2015-02-24T14:31:20.483 回答
0

SetStateRequest 消息是否不是设置状态和状态的适当方式?还是我错过了什么?

于 2013-02-06T23:12:05.697 回答