2014-04-08 4 views
1

이 코드 부분을 사용할 때 Select 쿼리 만 결과를 반환 할 수 있지만 Select2는 반환 할 수없는 이유를 말해주십시오. Pleasemysql에서 두 값을 반환합니다. C#

con.ConnectionString = mysqlSB.ConnectionString; 
       MySqlCommand Select = new MySqlCommand("select id from table1 where lang ='ua'", con); 
       MySqlCommand Select2 = new MySqlCommand("select id from table2 where car='bmw'", con); 

       MySqlDataReader myReader; 
       MySqlDataReader myReader2 ; 

       con.Open(); 

       myReader = Select.ExecuteReader(); 
       myReader2 = Select2.ExecuteReader(); 

return (myReader2["id"].ToString()); 
+0

두 개의 멤버로 '구조체'를 만들고 인스턴스를 반환하십시오. – Jon

답변

0

함수에 전달한 두 개의 'out'매개 변수를 사용하여 결과를 채울 수 있습니다.

public void MyFunction(out string res1, out string res2){ 
.... 
res1 = select.toString(); 
.... 
} 
관련 문제