[英]Execute Deployed SSIS Package from Asp.net c#
I have deployed a SSIS Package. 我已经部署了一个SSIS程序包。 I'm executing it with a procedure.
我正在执行一个过程。
Exec PushMannualData '0619','Jagri Pharmaceuticals','Yes','INTERNAL\Shaidar';
In SSMS, it is getting executed successfully. 在SSMS中,它已成功执行。
I am trying to connect this with ASP.NET to execute. 我试图将其与ASP.NET连接以执行。 I have written below code in C#:
我在C#中编写了以下代码:
using (SqlConnection Con = new SqlConnection(ConfigurationManager.ConnectionStrings["WindowsAuthenticationSQLConnection"].ToString()))
{
using (SqlCommand cmd = new SqlCommand("PushMannualData", Con))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Date", SqlDbType.VarChar).Value = TextBoxDate.Text;
cmd.Parameters.Add("@ProjectName", SqlDbType.VarChar).Value = DropDownListCompany.Text;
cmd.Parameters.Add("@PushProduct", SqlDbType.VarChar).Value = DropDownList2.Text;
cmd.Parameters.Add("@UserName", SqlDbType.VarChar).Value = Session["LoginName"];
Con.Open();
cmd.ExecuteNonQuery();
}
}
Connection string is 连接字符串为
<add name="WindowsAuthenticationSQLConnection"
connectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DATA1;Data Source=SQLSERVER" />
But I am facing issue with connection. 但是我面临着连接问题。
The Error is : System.ArgumentException: 'Keyword not supported: 'provider'.'
错误是:
System.ArgumentException: 'Keyword not supported: 'provider'.'
As suggested by @Nick.McDermaid in comment I removed Provider=SQLOLEDB.1;
正如@ Nick.McDermaid在评论中所建议的那样,我删除了
Provider=SQLOLEDB.1;
From the connection string and it worked. 从连接字符串,它的工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.