System.InvalidOperationException: ‘ExecuteReader: Connection property has not been initialized.’
سوال
علت خطای زیر چیست؟
SqlConnection _con = new SqlConnection ("Data Source = .; Initial Catalog = Shop3; Integrated Security = true;");
_con.Open();
SqlCommand cmd = new SqlCommand (" select * from Customer ");
SqlDataReader reader = cmd.ExecuteReader();
while ( reader.Read() )
{
Console.WriteLine("Customer Code: {0}nCustomer Name {1}nCustomer ...
در حال بررسی
0
انجمن برنامه نویسان سی شارپ
1 سال
1 پاسخ
208 دیده شده