StrataFrame Forum

MDDeployMain dialog returning OK when clicking Cancel button, why?

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

By Edhy Rijo - 12/26/2009

Hi Trent,



Implementing the MMDeployMain.vb class I need to know if the status of the database update, I am assuming that the cmdCancel button will return Windows.Forms.DialogResult.Cancel but instead is returning Windows.Forms.DialogResult.OK, why?



Am I missing some other property here that will let me know if the update completed or the user decided to cancel the process?



Thanks!
By Edhy Rijo - 1/4/2010

Bump....Smile
By Trent L. Taylor - 1/7/2010

This dialog is allowed for your use, however it was actually created for internal use and then exposed. You could have gotten around this by using the DatabaseMigrator class which is the actual intent versus the MMDeployMain. If you will recall, there is also a sample that you could have copied over that would get you 90% of the way there.



At any rate, I have changed the Cancel button to return the appropriate result which will be available in the next update which we are working on for release.
By Edhy Rijo - 1/7/2010

Thanks Trent.



I am using the MMDeployMain.vb class because I needed to implement this in a quick fashion to be polished later using the DatabaseMigrator class based on the sample which would have taken more time.
By Edhy Rijo - 1/31/2010

Hi Trent,



I am testing the new SF 1.7.0.6 and item 2528 is still returning "Cancel" instead of "OK".



At any rate I am using the DatabaseMigrator to automate the database update without user intervention and in other place I am using the MDDeployMain to have more control of what to be deployed.



I looked at the source in MDDeployMain.vb in the cmdCancel.Click and noticed that you are returning the DialogResult.OK, but in my testing code it is still returning "Cancel". Here is my code, probably I am doing something wrong:





'-- Create the deployment form

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

Dim lcFullFileName As String = IO.Path.Combine(IO.Path.GetDirectoryName(Reflection.Assembly.GetEntryAssembly.Location), DDTPackageName)

loDeploy = New MicroFour.StrataFrame.DBEngine.Deployment.MDDeployMain(lcFullFileName, DDTPackagePassword)

With loDeploy

.ViewSecurityKey = "UpdateDatabase"



UpdateDatabase = .ShowDialog() ' This is returning DialogResult.Cancel all the time.

.Close()

.Dispose()

End With

By Trent L. Taylor - 1/31/2010

Edhy,

Make sure that your assembly is being overwritten or that you didn't build old source code.  I am pretty confident on this one.  I will double-check tomorrow, but I made the change and tested it after you made this post.  Like I said, I will double check, but I wouldn't be surprised if something didn't get overwritten.