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;
}
答案 0 :(得分:0)