الى اساتذتي الاجلاء
عندي جدولين مربوطين قمت بعرض الاول بالتيكست بوكس والجدول الثاني بالداتا كرد كما في الكود الاسفل ارجو تعليمي كيفية الحفظ والتعديل والحذف لاني ابحث ولم اجد واحب التعلم ارجوا التعديل ولو بمثال
Imports System.Data.OleDb
Public Class Form1
Dim con As New OleDb.OleDbConnection()
Dim Myds As New DataSet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" & Application.StartupPath & "\MyData.mdb"
con.Open()
If con.State = ConnectionState.Open Then
MsgBox("تم الأتصال بقاعدة البيانات بنجاح", MsgBoxStyle.Information + MsgBoxStyle.MsgBoxRight = False + MsgBoxStyle.MsgBoxRtlReading = False + MsgBoxStyle.OkOnly, "برنامج الاتصال بقاعدة البيانات")
Else
MsgBox("لم يتم الاتصال ", MsgBoxStyle.Information + MsgBoxStyle.MsgBoxRight = False + MsgBoxStyle.MsgBoxRtlReading = False + MsgBoxStyle.OkOnly, "برنامج الاتصال بقاعدة البيانات")
End If
Dim Myds As New DataSet
Dim sql(1) As String
sql(0) = "select id,emp_name,emp_picture,deparment from emp "
sql(1) = "select name,nof from noam"
Dim daSudent As New OleDb.OleDbDataAdapter(sql(0), con)
Dim daSubject As New OleDb.OleDbDataAdapter(sql(1), con)
daSudent.Fill(Myds, "emp")
daSubject.Fill(Myds, "noam")
con.Close()
TextBox1.DataBindings.Add("Text", Myds, "emp.id")
TextBox2.DataBindings.Add("Text", Myds, "emp.emp_name")
TextBox3.DataBindings.Add("Text", Myds, "emp.emp_picture")
TextBox4.DataBindings.Add("Text", Myds, "emp.deparment")
<A name=OLE_LINK1>Me.DataGridView1.DataSource = Myds.Tables("noam")
'لتغير عنوان جدول الدات كراد"
DataGridView1.Columns(0).HeaderText = "رقم القسم"
DataGridView1.Columns(1).HeaderText = " القسم"