16-05-14, 09:00 PM
هذا كود لتمرير قيمة الحق الاساسى الى حقل اخر يسمى idnumber لا ادرى ما الخطأ فى هذا الكود
align*=left]
[code*]
cmd.Connection = sqlcon
Dim dr As SqlDataReader = cmd.ExecuteReader
If dr.HasRows Then
dr.Read()
txtrec1.Text = dr.Item("id")
txtid.Text = dr.Item("id")
' txtren.Text = dr.Item("name")
txtname.Text = dr.Item("name")
txtm.Text = dr.Item("mothername")
txtid.Text = dr.Item("id")
cbojob.SelectedValue = dr.Item("jobid")
txtdate.MyText = dr.Item("date")
txttel.Text = dr.Item("tel")
txtphone.Text = dr.Item("phone")
txtaddress.Text = dr.Item("address")
txtcomment.Text = dr.Item("comments")
cboage.SelectedText = dr.Item("age")
cbogender.SelectedText = dr.Item("gender")
cbomerital.SelectedText = dr.Item("merital")
txtpointer.Text = dr.Item("idnumber")
txtpointer.Text = dr.Item("id")
sqlcon.Close()
btnenabled1.Enabled = True
Else
MsgBox("السجل غير موجود ", MsgBoxStyle.Exclamation, "خطأ")
End If
[/code*]
[/align*]
align*=left]
[code*]
cmd.Connection = sqlcon
Dim dr As SqlDataReader = cmd.ExecuteReader
If dr.HasRows Then
dr.Read()
txtrec1.Text = dr.Item("id")
txtid.Text = dr.Item("id")
' txtren.Text = dr.Item("name")
txtname.Text = dr.Item("name")
txtm.Text = dr.Item("mothername")
txtid.Text = dr.Item("id")
cbojob.SelectedValue = dr.Item("jobid")
txtdate.MyText = dr.Item("date")
txttel.Text = dr.Item("tel")
txtphone.Text = dr.Item("phone")
txtaddress.Text = dr.Item("address")
txtcomment.Text = dr.Item("comments")
cboage.SelectedText = dr.Item("age")
cbogender.SelectedText = dr.Item("gender")
cbomerital.SelectedText = dr.Item("merital")
txtpointer.Text = dr.Item("idnumber")
txtpointer.Text = dr.Item("id")
sqlcon.Close()
btnenabled1.Enabled = True
Else
MsgBox("السجل غير موجود ", MsgBoxStyle.Exclamation, "خطأ")
End If
[/code*]
[/align*]