SqlCommand sqlcmd = new SqlCommand(sqlText, sqlconn);这一行后面改一下:Labname = string.Format("{0}", cmd.ExecuteScalar());sqlconn.Close();