티스토리 뷰

💼 정보 ver1.0

excuteReader()

James Wetzel 2012. 12. 24. 15:04
728x90
반응형

[읽기]

SqlConnection conn = new SqlConnection(connectionString);

conn.Open();                


SqlCommand comm = new SqlCommand();

comm.Connection = conn;

comm.CommandText = "StoredProcedure1";

comm.CommandType = System.Data.CommandType.StoredProcedure;

                

comm.Parameters.Add("@id", System.Data.SqlDbType.NVarChar).Value = "your ID";

comm.Parameters.Add("@password", System.Data.SqlDbType.NVarChar).Value ="your Password";


SqlDataReader reader =  comm.ExecuteReader();

if(reader.Read())

{

this.memberName = "장정훈";

      GreateSession();

      result = true;

}

else

{

result = false;

}

728x90
반응형