تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[سؤال] سؤال بخصوص كود برمجي
#1
Star 
  مدرج كود لكيفيه اختيار عناصر من DataGridView و عرض بياناته في فورم اخر بالنقر المزدوج عليها من DataGridView ..
لم يشتغل معي .. اريد ان اعرف المشكله ان امكن ؟؟
 Private Sub DataGridView1_DoubleClick(sender As Object, e As EventArgs) Handles DataGridView1.DoubleClick
        If (DataGridView1.RowCount > 0) Then

            Dim sql As String = "select p_name,(select c_name from t_clinic where c_id=t_patiants.c_id)as c_name,(select D_name from t_doctor where D_id=t_patiants.d_id)as d_name,p_birthday  from t_patiants  '" + DataGridView1.CurrentRow.Cells(0).Value.ToString + "'"
            Dim cont As New SqlCommand(sql, Class1.con)
            Dim dr As SqlDataReader

            Class1.con.Open()
            Try
                dr = cont.ExecuteReader
                If dr.HasRows Then
                    dr.Read()
                    Form3.Show()
                    Form3.Button4.Enabled = True
                    Form3.Button1.Enabled = True
                    Form3.Button3.Enabled = False
                    Form3.Button5.Enabled = False
                    Form3.p_id = dr("d_id").ToString

                    Form3.TextBox1 = dr("p_name")
                    Form3.ComboBox2.Text = dr("c_name").ToString
                    Form3.ComboBox1.Text = dr("d_name").ToString
                    Form3.DateTimePicker1.Text = dr("p_birthday").ToString

                End If
            Catch ex As Exception
                MsgBox("error", MsgBoxStyle.Exclamation)
                MsgBox(ex.Message)
            End Try
            Class1.con.Close()
        End If
            End Sub
الرد }}}
تم الشكر بواسطة:
#2
[attachment=8927][attachment=8927][attachment=8927]نعم القصد كما ارفقت في الصوره اخي ..
و قد قمت بارفاق هده البيانات في هده الخطوه ..

  Form3.p_id = dr("d_id").ToString

                    ("Form3.TextBox1 = dr("p_name"
                    Form3.ComboBox2.Text = dr("c_name").ToString
                    Form3.ComboBox1.Text = dr("d_name").ToString
                    Form3.DateTimePicker1.Text = dr("p_birthday").ToString


ارفقت رساله الخطأ بالملف

هدا هو الخطأ


الملفات المرفقة صورة/صور
   
الرد }}}
تم الشكر بواسطة:
#3
الافضل ارفاق مثال ليتم التعديل عليه .
الرد }}}
تم الشكر بواسطة:
#4
تم حل المشكله .. شكــراً
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم