Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services 如何为SSRS中的自定义代码添加System.Data.SqlClient引用?_Reporting Services - Fatal编程技术网

Reporting services 如何为SSRS中的自定义代码添加System.Data.SqlClient引用?

Reporting services 如何为SSRS中的自定义代码添加System.Data.SqlClient引用?,reporting-services,Reporting Services,您需要从报表属性U/I添加对程序集的引用 请查看此处的步骤和注意事项: public string getLabel(int ReportID, int labelID) { string s; System.Data.SqlClient.SqlConnection myConnection = new System.Data.SqlClient.SqlConnection("Data Source=*****;Persist Security Info=True;Passwor

您需要从报表属性U/I添加对程序集的引用

请查看此处的步骤和注意事项:

public string getLabel(int ReportID, int labelID)
{
    string s;
    System.Data.SqlClient.SqlConnection myConnection = new System.Data.SqlClient.SqlConnection("Data Source=*****;Persist Security Info=True;Password=****;User ID=*********;Initial Catalog=iLoyaltyDW");
    SqlCommand myCommand = new SqlCommand();
    myCommand.Connection = myConnection;
    myCommand.CommandType = CommandType.Text;
    myCommand.CommandText = "select ....";
    myConnection.Open();

    SqlDataReader reader = myCommand.ExecuteReader();

    while (reader.Read())
    {
        s = reader.GetString(0);
    }

    return s;         
}