السلام عليكــم ورحمـة الله وبركاتــه ،،
عايزاه اعرف الخطاء دا نتيجة ايه دلوقتى عاملا استعلام بالشكل دا
- If cn.State = ConnectionState.Open Then cn.Close()
- cn.Open()
- cmd.Parameters.Clear()
- cmd.CommandText = "select * from item where name=@name5"
- cmd.Parameters.Add("@name5", SqlDbType.VarChar).Value = ListBox1.Text
- dr = cmd.ExecuteReader
- While (dr.Read)
- TextBox1.Text = dr("id")
- TextBox2.Text = dr("no")
- TextBox3.Text = dr("name")
- TextBox4.Text = dr("name_eng")
- TextBox5.Text = dr("kind")
- TextBox6.Text = dr("amount")
- TextBox7.Text = dr("amount1")
- TextBox8.Text = dr("price")
- TextBox9.Text = dr("price1")
- TextBox10.Text = dr("tax")
- TextBox11.Text = dr("pay")
- TextBox12.Text = dr("out")
- TextBox13.Text = dr("loc")
- TextBox14.Text = dr("company")
- TextBox15.Text = dr("notes")
- CheckBox1.Checked = dr("work")
- TextBox22.Text = dr("date")
- End While
بس بيظهر عندى error وبيقف على no مش عارفا ليه
وبيظهرى رسالة بيقول فيها no بس ومفهاش اى حاجة تانية
ولما اوقفه تعترض على السطر الى بعده وهكذا
طبعا دا استعلام من جدول علشان يعرض كل الحقول فى text بناء على القيمة فى listbox