4
Reply

how to use result of class in mainForm ?

ghasem deh

ghasem deh

May 20 2015 12:16 AM
430
hi, 
i want use result  of class in mainForm and display in lable :
 
public void Amar()
{
try
{
SqlConnection con = new SqlConnection(ConString);
SqlCommand com = new SqlCommand("select COUNT(*) from Software", con); // ????? ??? ????? ??? ???
con.Open();
SqlDataReader dr = com.ExecuteReader();
if (dr.Read())
{
int count = Int32.Parse(dr[0].ToString());
}
}
catch
{
Warning.ShowBox(@"! ??? ?????? ??????? ?? ????
???? ?? ????? ?????? ?? ???? ????? ????", "?????");
}
} 

Answers (4)