Click here to Skip to main content
15,899,124 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
C#
OleDbConnection Dc = new OleDbConnection("Provider=Microsoft.Ace.OLEDB.12.0; Data Source=D:\\Dat.accdb");
        OleDbDataAdapter DA = new OleDbDataAdapter();
        DataSet dset = new DataSet();
        DataView Dv = new DataView();
        void fillData()
        {
            Dc.Open();
            DA.SelectCommand = new OleDbCommand();
            DA.SelectCommand.Connection = Dc;
            DA.SelectCommand.CommandText = "Select* From Table1";
            dset = new DataSet();
            DA.Fill(dset, "T1");
            Dv = new DataView(dset.Tables["T1"]);
            Dc.Close();

        }

        void BindtextBoxes()
        {
            textBox1.DataBindings.Clear();
            textBox2.DataBindings.Clear();
            textBox3.DataBindings.Clear();
            //textBox4.DataBindings.Clear();
           // textBox5.DataBindings.Clear();
            textBox1.DataBindings.Add("Text", Dv, "ID");
            textBox2.DataBindings.Add("Text", Dv, "Name");
            textBox3.DataBindings.Add("Text", Dv, "Marks");
           // textBox4.DataBindings.Add("Text", Dv, "Address");
          //  textBox5.DataBindings.Add("Text", Dv, "Age");
        }
Posted
Updated 15-Mar-14 22:13pm
v2

 
Share this answer
 
Comments
Fadii GX 17-Mar-14 2:30am    
thanks #krunal rohit yes my basic concept are not so good you provided answer is help full
. i hope next time i will clearly discus my question
regards
Krunal Rohit 17-Mar-14 2:31am    
Glad I could help :)

-KR
I'd suggest to start here: Data Programming with Microsoft Access 2010[^]
When you finish reading above article, have a look here: Accessing Microsoft Office Data from .NET Applications[^]

Next time, please be more specific and provide more details about your issue. Please, read CP's rules: Code Project Quick Answers FAQ[^]
 
Share this answer
 
Comments
Fadii GX 17-Mar-14 2:32am    
thanks sir , next time i will be care full about my queries
regards
Maciej Los 18-Mar-14 17:13pm    
You're welcome ;)
If my answer was helpfull, please mark it as an answer (green button).
Maciej Los 18-Mar-14 17:14pm    
--duplicate comment was removed--

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900