Okay, not sure if this is the proper place to post this, but I have been searching all over and don’t know where else to post this, so here it goes.
1) I created a simple database in Access 2003 with 3 rows:
- Last Name (text)
- Age (number)
- Sex (text)
2) I created a connection to the database in Visual Studio Pro 2005 with C#
3) I opened the “Data Sources” tab and dragged the 3 controls (last name, age, sex) over onto my windows form and all 3 showed up as text boxes.
4) Built and test ran my application (in “Debug” mode) and it worked wonderfully (stored data in the database and retrieved it).
5) PROBLEM – at that time I realized I had forgot to add another row for “Zip code”.
6) So I opened up my database I had created early back up in Access 2003 and added a 4th row:
- Last Name
- Age
- Sex
- Zip code
7) MY QUESTION: How do I get the “data source” to update so that I now see a control for “Zip code” as well in my data sources tab without having to create a new database, connect to it, and drag all the controls to the windows form all over again
Please help. Thank you!
C# and Access 2003 Database
Adam Eldred
Hi,
Look in your project, you should have a dataset file. Open this file in the designer, remove the table, open server explorer (view/server explorer) and drag your table in the dataset. Recompile and you should see the new field in the data source view.
Charles
DavidCeder
wBob
Actually it's not complicated.
Just go to Add new item -> sql database. In the solution explorer double click on the database .mdf file to open it in the server explorer. You the expand to node until you find the table node, right-click/create table and enter the fields in the grid that appear, very similar to access.
Charles