Site hosted by Angelfire.com: Build your free website today!
« December 2008 »
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Entries by Topic
All topics  «
Blog Tools
Edit your Blog
Build a Blog
RSS Feed
View Profile
You are not logged in. Log in
My Blog
Monday, 19 May 2008

 Ø¨Ø§Ù„وضع المن٠صل  ÙŠØ³ØªØ®Ø¯Ù… قاعدة بيانات اكسس Ùˆ نموذج برنامج ادخال بيانات

 

ملاحظة:جميع الاجزاء الملونة تكتب Ù ÙŠ سطر واحد    

 Dim ac As New OleDb.OleDbConnection

        Dim acons As String

        Dim ds As New DataSet

        Dim sq As String

acons = "provider=microsoft.jet.oledb.4.0;" + "data source=f:\d_student\db1.mdb;"

                    ac.ConnectionString = acons

        sq = " select no,name,tm,se,nat,mm,class,dr,mn from g1"

        Try

            ac.Open()

            If TextBox1.Text = "" Then Exit Sub

            Dim da As New OleDb.OleDbDataAdapter(sq, ac)

            da.Fill(ds)

ds.Tables(0).Rows.Add(New Object() {TextBox1.Text, TextBox2.Text, ComboBox1.Text, ComboBox2.Text, TextBox3.Text, ComboBox2.Text, ComboBox3.Text, ComboBox4.Text, TextBox5.Text})

 

            Dim cb As New OleDb.OleDbCommandBuilder(da)

            da.SelectCommand = cb.GetInsertCommand

            da.Update(ds)

            MsgBox("لقد تم ح٠ظ البيانات بنجاح ("

      Catch ex As Exception

 

        End Try

        ac.Close()

 

 

 

 

بالوضع المن٠صل  ÙŠØ³ØªØ®Ø¯Ù… قاعدة بيانات اكسس Ùˆ نموذج برنامج بحث عن بيانات

 

 

 

 

 

 

        TextBox1.Text = "" :        TextBox2.Text = ""

        TextBox3.Text = "" :        TextBox4.Text = ""

        TextBox5.Text = "" :        ComboBox1.Text = ""

        ComboBox2.Text = "":   ComboBox3.Text = ""

        ComboBox4.Text = ""

        Dim sr As Object

                    sr = InputBox("ادخل رقم قيد الطالب الذي تريد البحث عنة", "بحث")

                    Dim ac As New OleDb.OleDbConnection

                    Dim acost As String

        Dim sq As String

        Dim ds As New DataSet

        acost = "provider=microsoft.jet.oledb.4.0;" + "data source=f:\d_student\db1.mdb;"

        sq = "select * from g1 where [no]= " & "'" & sr & "'"

                    ac.ConnectionString = acost

                    Try

            ac.Open()

            Dim da As New OleDb.OleDbDataAdapter(sq, ac)

            da.Fill(ds, "g1")

            TextBox1.Text = (ds.Tables("g1").Rows(0)("no"))

            TextBox2.Text = (ds.Tables("g1").Rows(0)("name"))

            TextBox3.Text = (ds.Tables("g1").Rows(0)("tm"))

            ComboBox1.Text = (ds.Tables("g1").Rows(0)("se"))

            ComboBox2.Text = (ds.Tables("g1").Rows(0)("nat"))

            ComboBox3.Text = (ds.Tables("g1").Rows(0)("mm"))

            ComboBox4.Text = (ds.Tables("g1").Rows(0)("class"))

            TextBox4.Text = (ds.Tables("g1").Rows(0)("dr"))

            TextBox5.Text = (ds.Tables("g1").Rows(0)("mn"))

        Catch ex As Exception

            MsgBox("لايوجد")

        End Try

        ac.Close()

          End Sub

بالوضع المن٠صل  ÙŠØ³ØªØ®Ø¯Ù… قاعدة بيانات اكسس Ùˆ نموذج برنامج بحث عن بيانات

 

 

 

 

 

 

 

 

 

Dim ac As New OleDb.OleDbConnection

        Dim acons As String

        Dim ds As New DataSet

        Dim sq As String

        acons = "provider=microsoft.jet.oledb.4.0;" + "data source=f:\d_student\db1.mdb;"

        ac.ConnectionString = acons

        sq = " select  *  from g1"

        Try

            ac.Open()

            Dim da As New OleDb.OleDbDataAdapter(sq, ac)

            da.Fill(ds, "g1")

            DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells

 

            DataGridView1.Rows.Clear()

            Dim i As Integer

            For i = 1 To ds.Tables("g1").Rows.Count - 1

 

                DataGridView1.DataSource = ds.Tables("g1")

 

            Next i

        Catch ex As Exception

        End Try

        DataGridView1.Refresh()

        ac.Close()

 

 

 

no

name

tm

se

nat

mm

class

dr

mn

100

محمد عبد السلام محمد علي

12/8/1985

ذكر

ليبي

طرابلس

الثاني

1/1/2003

منى

50

هاني محمد سالم محمود

1/1/1990

ذكر

مصري

القاهرة

الثالث

2/2/2001

ليلي

101

منير محمد عبدو

12/8/1988

ذكر

مصري

طرابلس

الرابع

9/5/2005

نادين

120

سلسبيل ناجي محمود

12/8/1999

انثى

عراقي

طرابلس

الخامس

1/8/2005

نرمين

155

مروه ٠رج م٠تاح

6/6/1988

انثى

تونسي

بنغازي

الثاني

2/9/2006

مريم

24

مجاهد محمد

1980

ذكر

مصري

طرابلس

الثالث

12/8/1980

نوال

تركيبة جدول قاعدة البيانات

 

Patch    ( D:\student\db1.mdb)

Database Name ( db1.mdb)

Table Name  ( g1)


Posted by log3d at 9:49 AM EDT
Post Comment | Permalink | Share This Post

Newer | Latest | Older