mahdi5121
پنج شنبه 30 تیر 1390, 00:15 صبح
سلام ...
این کد ، کجاش اشکال داره ؟
try
{
con = new SqlConnection("Data Source=localhost;Initial Catalog=Test;Integrated Security=True");
}
catch (SystemException ex)
{
MessageBox.Show(ex.Message);
}
try
{
strSql = "SELECT Name FROM Person";
com = new SqlCommand(strSql, con);
con.Open();
SqlDataReader Reader = com.ExecuteReader();
dataGridView1.Rows.Add(Reader.GetValue(0).ToString ());
con.Close();
}
catch (SystemException ex)
{
MessageBox.Show(ex.Message);
}
این کد ، کجاش اشکال داره ؟
try
{
con = new SqlConnection("Data Source=localhost;Initial Catalog=Test;Integrated Security=True");
}
catch (SystemException ex)
{
MessageBox.Show(ex.Message);
}
try
{
strSql = "SELECT Name FROM Person";
com = new SqlCommand(strSql, con);
con.Open();
SqlDataReader Reader = com.ExecuteReader();
dataGridView1.Rows.Add(Reader.GetValue(0).ToString ());
con.Close();
}
catch (SystemException ex)
{
MessageBox.Show(ex.Message);
}