Jump to content
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

ربط الاكسس بالسي شارب entity framework


AliAli47

Recommended Posts

السلام عليكم 

اريد انشاء برنامج بلغة سي شارب واريد ربطه بقاعدة بيانات اكسس عن طريق تقنية entity framework 

فهل من طريقة لربطه بالاكسس  لاني لم اجد غير السيكوال عند استعمال التقنية

 

Link to comment
Share on other sites

تفضل اخي الكريم

using System.Windows.Forms;

 using (OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Data.mdb;"))
                {
                    using (OleDbCommand cmd = new OleDbCommand("SELECT CustomerId, Name FROM Customers"))
                    {
                    cmd.CommandType = CommandType.Text;
                    using (OleDbDataAdapter sda = new OleDbDataAdapter(cmd))
                    using (DataTable dt = new DataTable())
                    {
                        sda.Fill(dt);
                        dataGridView1.DataSource = dt;

                    }
                }
                }

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information