|
HI
Is there any way to set the priorities of the Pre-Requisites. I have created a setup in VS2008 and added all the pre-requisites. But not able to set the priority. For Example I have the following products as per pre-requisites:
MYSQL
DbCreate
Dot Net 4.0
I would like the priority to be
Dot Net 4.0
MySql
Dbcreate
Can anyone help me please?
|
|
|
|
|
There is no "priority" support built into MSI. If you want to support this kind of thing, you'd have to wrap your entire installation in a Setup.exe that your write yourself.
This .EXE would check to see if each product is installed and then launch the installers for them seperately.
|
|
|
|
|
SPSandy wrote: Is there any way to set the priorities of the Pre-Requisites That does not sound logical.
It's the installer that determines the priorities, based on dependencies; if DbCreate is using .NET, then it should either be contained in the package for DbCreate, or be listed as a dependency for DbCreate.
Why do you want to influence the order of execution?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for the reply.
I will try to put my doubts in words.
As given in the example, Dot Net4.0 is a pre-requisite for the installation of MySql. And MySql is a pre-requisite for the execution of DbCreate.
This is the reason I am a little confused whether it will run according to this steps or will it just run whichever comes first.
|
|
|
|
|
SPSandy wrote: As given in the example, Dot Net4.0 is a pre-requisite for the installation of MySql. No, it's not. MySQL does not NEED .NET 4 to run.
IF it did, then the package that installs MySQL would need to install .NET 4; it would not be a separate install.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am sorry but it does need Dot Net 4.0 to install and it does not come with the installer. It has to be installed separately. At least this is true for MySql Server 5.1
|
|
|
|
|
SPSandy wrote: I am sorry Don't be - you obviously tried it, and I'm merely whining about how they should have created their installer.
I've been Googling a minute for an MSI that includes .NET 4, but can't find it. Will be looking for a place to complain next.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have actually solved the problem of defining the steps for installer.
|
|
|
|
|
Hi
Thanks. I was able to sort out according to the required steps.
This issue can be treated as closed.
|
|
|
|
|
Hello which is the best way of connecting VB6 application with sql serverv 2000 ?
|
|
|
|
|
VB6 support ended in april 2008. Support for Sql Server 2000 ended in april 2013[^]. The combination will be limited to 32-bits, and, hence, 32-bit libraries and controls.
The "best" way to connect a VB6-application has not changed; you'd use ADOX as described. There's enough examples on the internet[^].
I'd also like to point out that there are FREE alternatives to the tools you named; VB.NET can be downloaded for free (search vb.net express) and same goes for Sql Server (search for sql server express). There's a LOT more examples on using those, as they have replaced the older tools.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello !
I have an application on Visual Basic 2013 , Entity Framework 6.02 , Sql server 2008R2.
I have several identical databases.
on design , I have created through wizard the connection with one of them ( For example MyDB1) and I have configured the Entity. Now , on runtime , I want to give the users the possibility to disconnect from the database MyDB1 and to connect to another (identical) database for example MyDb2.
How can I do this through code ?
Thank you !
|
|
|
|
|
There are two things you have to do. The first is change the connection string to whatever you need.
All you have to do is replace the part of the connection string that specifies the database and/or server name the database is on.
The second is that you have to wrap your DbContext class with a partial class and supply a new constructor that accepts a connection string:
Partial Public Class MyDbContext
Public Sub New(connectionString As String)
If String.IsNullOrWhiteSpace(connectionString) Then
Throw New ArgumentNullException("connectionString")
End If
Database.Connection.ConnectionString = connectionString
End Sub
End Class
Whenever you need to create a new instance of your DbContext, you just pass the connection string to the wrapper which will pass it to the ConnectionString property of the DbContext for you.
|
|
|
|
|
Hello !
But how to change the connection string ?
As I can see inside visual studio , the connection string is inside the app.config.How can I change on runtime the part that specifies the database and server ?
For the second thing , where should I put the code ?
And finally , let suppose that I have a textbox where I write the name of the database that i want to connect. And I have a button that make the connection. What code should I pass to the button.click event ?
Thank you !
|
|
|
|
|
This is simple string manipulation. In the app.config file, replace the database name in the connection string with a tag that's easily locatable, like this:
Server={SERVER};Database={DATABASENAME};User Id=myUsername;Password=myPassword;
* This connection string will only an example. Copying and pasting it will do you no good.
The tags, "{SERVER}" and "{DATABASENAME}" are easily found by code and replaced with a line like this:
Dim newConString As String = connStringTemplate.Replace("{SERVERNAME}", serverName).Replace("{DATABASENAME}", databaseName)
|
|
|
|
|
in my app.config , there are many lines , but Connection string is :
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=USER-PC;initial catalog=MyDB1;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
I don't have Server=.... and Database=....
???
|
|
|
|
|
Excuse me, but where in this process did I say "stop thinking for yourself"?
Do you see anything in your connection string that looks familiar?? Like that "MyDB1" looks like your database name!!
How about "USER-PC"?? Doesn't that look like the name of your own workstation?? You apparently have SQL Server installed on your machine!
|
|
|
|
|
Thank you !
in this line :
Dim newConString As String = connStringTemplate.Replace("{DATABASE}", "MyDB2")
I get an error connStringTemplate is not decared.
How should I declare ?
Thank you !
|
|
|
|
|
That's what you get for blindly copying and pasting code without thinking about it. You're not even ATTEMPTING to figure out what's going on, are you?
That variable doesn't exist in your code because IT'S AN EXAMPLE! connStringTemplate would be replaced by the variable you define in your code that is holding the connection string template that you're searching and replacing the tags in.
Start THINKING!
|
|
|
|
|
Thank you !
I thought that connStringTemplate was a system object that hold the connection string.
Ok but if I declare this variable , how can I set his value to current connection string ?
Thank you !
|
|
|
|
|
|
Thank you !
This is my code for changing the connection String :
Dim connstringtemplate As String = System.Configuration.ConfigurationManager.ConnectionStrings(1).ConnectionString.ToString
Cnstring = connstringtemplate.Replace("{DATABASE}", "MyDB2")
This is My partial class
Partial Public Class MyEntities
Inherits DbContext
Public Sub New(connectionString As String)
If String.IsNullOrWhiteSpace(connectionString) Then
Throw New ArgumentNullException("connectionString")
End If
Database.Connection.ConnectionString = connectionString
End Sub
Entity declaration :
context = New MyEntities(cnstring)
But now on runtime i get an error on the line
Database.Connection.ConnectionString = connectionString
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll
Additional information: Keyword not supported: 'metadata'.
|
|
|
|
|
Please , any help what can I do ?
Thank you !
|
|
|
|
|
alejx wrote: what can I do ?
Learn to use the debugger built into Visual Studio.
Obviously, it's compaining about something in the connection string, but there's no way for anyone but YOU to determine what that is.
|
|
|
|
|
Thank you !
The error that I get is :
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll
Additional information: Keyword not supported: 'metadata'.
And on my connection string in app.config I have "metadata" keyword :
<connectionStrings>
<add name="DyqaniEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=USER-PC;initial catalog=Dyqani;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
If metadata is not supported , what can I do for my connection string ?
thank you !
|
|
|
|