How to retrieve data from table using its key?

I have two tables in Access which contain many similar fields. Now I want it so if I fill data in table 1, it will automatically fill the same data in table 2 and avoid re-filling. How can I do this using C#?

  • I want to use this database in my C# application. So, in case if you are making query please tell how to run it using C#. (Code) Thanks in advance.

  • Answer:

    If you want to work with Access Databases via C# you're going to want to use the OleDbConnection classes. Just do a Google search for "connecting to access with C#" and you will find lots of examples.

Eric Wise at Quora Visit the source

Was this solution helpful to you?

Other answers

You are violating the basic premise of the relational data model.  Logically you wouldn't want to put the "same data" in Table 2 as you put in Table 1.  You want to merely put a pointer or "foreign key" in Table 2, me thinks.  A query that combines Table 1 with Table 2 is probably what you need?  This has nothing to do with what language you program in.  It has to do with your underlying data model.

Christopher Rauch

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.