StrataFrame Forum

Sample Data Installer Class

http://forum.strataframe.net/Topic31444.aspx

By Terry Bottorff - 9/15/2012

I am trying to use the "SampleDataInstallerClass" but the syntac for most of the statements are incorrect. Of course I am using one I found on the forum from a long time ago. Is there one later that will work with VS2010?

TIA.
By Terry Bottorff - 9/15/2012

As a follow up. These statements do not work.

 

Dim loDeploy As MicroFour.StrataFrame.DBEngine.Deployment.MDDeployMain



'-- Create the deployment form

loDeploy =

New MicroFour.StrataFrame.DBEngine.Deployment.MDDeployMain(lcPath & "StrataFrameSample.pkg", "framework")

By Edhy Rijo - 9/15/2012

Hi Terry,

Make sure you add the MicroFour StrataFrame DBEngine assembly to your project.
By Terry Bottorff - 9/15/2012

I'll do that as soon as I get back to my machine. Thank you and I'll let you know what happens.
By Terry Bottorff - 9/16/2012

These are the Imports for This Project.

MicroFour.StrataFrame.Strings.StringBasics

MicroFour.StrataFrame.DBEngine

MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs

 

But These are All of the Errors I am getting now. Ug.... Oh and by the way I am now trying to use the sample I found with my current version of SF 1.7



Error      6              'DatabaseMigrator' is notdeclared. It may be inaccessible due to its protection level.

1                    The primary reference "MicroFourStrataFrame DBEngine, Version=1.7.0.0, Culture=neutral,PublicKeyToken=99fe9917f71608a7, processorArchitecture=MSIL" could not beresolved because it has an indirect dependency on the framework assembly"System.Core, Version=3.5.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089" which could not be resolved in thecurrently targeted framework. ".NETFramework,Version=v2.0". Toresolve this problem, either remove the reference "MicroFour StrataFrameDBEngine, Version=1.7.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7,processorArchitecture=MSIL" or retarget your application to a frameworkversion which contains "System.Core, Version=3.5.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089".

2                    Error              3              Type 'DatabaseMigrator' is notdefined.               

3                    Error              4              Type 'DatabaseMigrator' is notdefined

4            Error      5              Type 'DeployDataInfo' is notdefined.

 Error     7              Type'MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs' is not defined.

Error      8              Type'MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs' is not defined.

Error      9              Type'MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs' is not defined.

Error      10           Type'MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs' is not defined.       

Error      11           Type'MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs' is not defined.

Error      2              Type 'SQL.DatabaseMigrator' is notdefined.

By Terry Bottorff - 9/16/2012

I have another question. Is there a way to control where the Database end up? In other words, can I direct it to a specific subdirectory?
By Trent L. Taylor - 9/17/2012

Terry:

The stack trace message is a fairly straight forward one.  If you look at it, it is a .NET 3.5 / .NET 2.0 reference issue.  StrataFrame is compiled in .NET 2.0 out of the box, but if you have downloaded the source, you can compile it for .NET 3.5, which you may have.  There is nothing wrong with this, but you will need to make your downstream projects match the target version of .NET.  For example, you sample project needs to be changed to a .NET 3.5 project if you leave it like this.

You can set the target version.  In VB.NET, it looks like this:

http://forum.strataframe.net/Uploads/Images/1c4e012d-4305-4e18-82a9-8b75.png

You get to it through the Advanced Compiler Options:

  1. Right click on your project
  2. Go to Properties
  3. Click on the Compile tab on the left
  4. Click Advanced Compile Options at the bottom
  5. Set the desired framework
In CSharp, it is actually easier to set.

  1. Right click on your project
  2. Go to properties
  3. Click on the Application tab
  4. You will see the target version right on the application page
By Terry Bottorff - 9/17/2012

I thought I tried that but I will have another look at it and let you know.

Thank you so much.
By Terry Bottorff - 9/18/2012

There are 2 projects in the solution. I changed the .Net on one of the solutions to 3.5 but not the other. Op's...... Now it Works.

But I still have the question, Is there a way to make sure that the database ends up an a particular subdirectory? If I copy the pkg to C:\test and run the Sample Data Installer Class on that pkg in that subdirectory is that where the Database will end up?

TIA.

And Thanks for the help on .Net 3.5 Version.
By Trent L. Taylor - 9/18/2012

Are you wanting to know how to make a database end up in a certain directory when you create it through the DDT or if you are just restoring it using a BAK or reattaching an MDF?  In the latter two, as long as the databases are local, you can specify any directory you want.  When you create a new database through transact SQL, then you can use the "ON" command as part of the CREATE DATABASE:

CREATE DATABASE database_snapshot_name     ON     (        NAME = logical_file_name,        FILENAME = 'os_file_name'     Wink [ ,...n ]


Refer here for more details about the CREATE DATABASE:

http://msdn.microsoft.com/en-us/library/ms176061.aspx

If you are using the DDT, then no.  It will use the SQL Server Instance pre-defined default database location when the databases are created.  Hope that this helps.
By Terry Bottorff - 9/18/2012

I was talking about using DDT. Therefore, I just need to know where to tell the client to look for the Database when they run the program the first time.

If the database already exists will DDT honor where it is found or will it also put it in the SQL Server Instance pre-defined default database location?

TIA.
By Edhy Rijo - 9/18/2012

Hi Terry,

Terry Bottorff (9/18/2012)
If the database already exists will DDT honor where it is found?

Yes.

Basically the rules is this, MS-SQL Server is responsible to handle the location of the databases (see attached image), the DBA or person in that role can configure the path where the database would be located, but a client application will not or should not even know anything about where the database file is located for security purpose, so the DDT has not way to create a database in a predefined path that may not even exist in the SQL Server.

What I normally do, is that since I am mostly the one to even install MS-SQL Express at the customer site, I create a data folder in the best drive possible and name it something like E:\MS-SQL Data Files, then at that point I let the customer know where the file is so they can do daily backups using the free program SQL Backup and FTP, this program is just a jewel because I can automate backups for up to 2 databases with free version and even upload the backup to an FTP site and get an email confirmation with status daily.
By Terry Bottorff - 9/19/2012

Alright, thank you for the great explanation. That all makes sense but do you change the default location so when you use DDT it put the database where you want it or how do you make sure your data get's to the where you want it?

Also, the backup piece of software is great. Thanks........
By Edhy Rijo - 9/19/2012

Terry Bottorff (9/19/2012)
That all makes sense but do you change the default location so when you use DDT it put the database where you want it or how do you make sure your data get's to the where you want it?

Yes, I change the location so me and most important the customer knows where the database is located.  DDT will either create or update the database based on the setup location in SQL Server configuration.
By Terry Bottorff - 9/19/2012

Cool. Great. Thank You.