SQL 조회에서 카운트 캡처 C#(.cs 파일)에서 SQL 명령에서 카운트를 가져오는 가장 간단한 방법은 무엇입니까? SELECT COUNT(*) FROM table_name 의 상태로.int변수?SqlCommand를 사용합니다.Scalar()를 실행하고 다음으로 캐스트합니다.int: cmd.CommandText = "SELECT COUNT(*) FROM table_name"; Int32 count = (Int32) cmd.ExecuteScalar(); SqlConnection conn = new SqlConnection("ConnectionString"); conn.Open(); SqlCommand comm = new SqlCommand("SELECT COUNT(*) FROM table_name", c..