Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Access Objects
Message
De
09/09/2007 11:51:37
 
 
À
09/09/2007 00:50:10
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01251542
Message ID:
01253287
Vues:
22
Hi John,

>Not a snag, but I have a curiosity question. For the database creation when you install, or to modify the tables when you upgrade a system, do you write that in c# or do you write it in SQL?

Some people here will surely get a kick out of this, but we're still using an old VFP app I wrote about 5 years ago to handle our SQL database creation and updates. It uses SQL DMO. I'm sure the concept that we use for this can be converted to a .NET app, but so far we haven't had the time or resources to do it. It works great as is, and since it's strictly a server side app, it's not really an issue to deploy it for our customers (since it doesn't get to the workstations at all).

What's nice about using VFP is that it's easy to keep all the database schema change scripts in a .dbf. You see, we "version" our SQL database ... every entry in our .dbf has a sequential version number and the schema change script. The SQL database has a table that holds the current version number. Whenever you update your database, it checks the most recent script change version number in the .dbf against the database's version number and only runs the appropriate scripts. It works quite nicely. A list of .sql files containing Stored Proc definitions is stored in another .dbf file and those are easy to update too ... all our Stored Procs are dropped and recreated each time.

>(Edit: 1:25am PST) I just filled a typed dataset using roughly the technique you described and it worked great! I even managed to allow for the use of alternate data providers in the design.

That's great! But quit working so late!!! <g>

~~Bonnie


>>>I'll let you know if I run into any trouble, but I'm rolling pretty good at the moment.
>>>
>>>Thanks again for your help.

>>
>>You're welcome. =0)
>>
>>Let us know if you run into any snags.
>>
>>~~Bonnie
>
>Not a snag, but I have a curiosity question. For the database creation when you install, or to modify the tables when you upgrade a system, do you write that in c# or do you write it in SQL?
>
>I have mine in c# using SMO at the moment but was curious to find out what others are doing.
>
>(Edit: 1:25am PST) I just filled a typed dataset using roughly the technique you described and it worked great! I even managed to allow for the use of alternate data providers in the design. Classes are messy looking right now, but I think I'll have a decent DAL when I clean them up.
>
>Thanks Again!!!
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform