954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C# form1 form2 pulling info from specific table only

Im a newbie and im working with 4 forms, first form is a main menu which has 6 buttons, if one of the button is clicked, a view only form is shown. this view only form has add edit and delete buttons. if edit or add is clicked, a single form is shown. if add, all fields are blank and if edit, data source is pulled from rows selected. my problem is: I created 1 database in access 07 with multiple tables. atleast 12 tables and every 2 tables are related with each other. all tables are not related with each other but by two's. there is a primary key for each and a foreign key for another. what i want to do is: since i have 6 buttons in form1 which is main form, i want to pull a specific table from my database to fill the form 2. which means, using the same form but with different data filled depending on the button that is clicked from the form1. i hope you can help me find a solution for this. give me an example if i have to do a constructor or a method for this. thank you.

anthonyjpv
Junior Poster in Training
97 posts since Oct 2010
Reputation Points: 16
Solved Threads: 7
 

can you give me an example of a method I can use on this scenario:

i have ole db with 2 tables not related with each other.

i have connected the db to c# form.

on form1 theres button1 and button2.

i want to:

if button1 is clicked, load form2 or fill with table1 ONLY else load form2 with table2 ONLY.

do I have to use delegate? constructor? method? class?

if you can give me an example please thank you!

anthonyjpv
Junior Poster in Training
97 posts since Oct 2010
Reputation Points: 16
Solved Threads: 7
 

>i want to pull a specific table from my database to fill the form 2.

You need to write code to fetch the result in from table. I have sample app for you.

Attachments daniapp1.zip (54.21KB)
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: