Reporting services 如何为SSRS中的自定义代码添加System.Data.SqlClient引用?
您需要从报表属性U/I添加对程序集的引用 请查看此处的步骤和注意事项: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
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;
}