[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

I created a dataset from an access db and developed app.  Database structure changed- how can i update my dataset w/o starting from scratch?

Posted on 2008-02-02
3
Medium Priority
?
149 Views
Last Modified: 2013-12-17
I developed an application around a simple Access database.  Then, one of the database table names changed.  

How do I go about updating the dataset classes and table adapters i'm using through out my code?

Could someone point me in the right direction for how you're supposed to go about updating the "dataSet" classes that were automatically generated for me using the Visual Studio Data Source.

I attempted to change all the strings i could find of the `OldTableName` with the `NewTableName` in the dataset.designer.cs files (which is technically a no no since it's an auto generated file) but i still get Ole exceptions stating the old table name cannot be found.

The tableAdapter's aren't updated when a table name is changed... is what i've gathered.  Is there any type of refactoring support?  

Perhaps there is a way of making some type of alias table name in MS Access?
0
Comment
Question by:blak3r
  • 2
3 Comments
 
LVL 22

Expert Comment

by:p_davis
ID: 20808852
did you do a search of the entire solution with the oldtablename?
0
 

Author Comment

by:blak3r
ID: 20816154
Yes.

The files i was updating were automatically generated files.  
So, i think they may be regenerated when i rebuild.
0
 

Accepted Solution

by:
blak3r earned 0 total points
ID: 21349719
I never found an ideal solution.  What i ended up doing is manually keeping them in sync.

I found that if you right click on the dataset designer and Add a new TableAdapter you can right a SQL query that will connect to your database and create a complete Dataset+TableAdapter for your new column (it recognizes relations and everything).

For example if you added a new Table called Products

Add new TableAdapter, Specifying the Connection string to your database, Select Multiple rows, then add the following SQL:

<code>
SELECT *
FROM Products
</code>

The rest is self explanatory.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses

613 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question