[RESOLVED]vb.net 2003 setup project doesn't work on another sqlserver
hi!!!
i have deployed a windows application in vb.net 2003 with an sqldatabase on my sqlserver...
i have deployed my database and i want to install sql server and my database on another computer and give my setup to the client.
if i do that it doesn't work...
what i have to do in order to work???? :confused:
Re: vb.net 2003 setup project doesn't works on another sqlserver
Have you made sure that the connectionstring in your application is using the correct SQL Server Name?
Ideally I would put all the connection strings in the App.Config file, so that even if the Server Name or something else changes, I will just have to update the app.config and not the actualy source code.
Re: vb.net 2003 setup project doesn't works on another sqlserver
sorry because i'm new to that where is the appconfig file????
and what do i have to write in there???
i have only one connection string showing my sqlserver!!!
do i have to include to my set up any files for the authentication of the database????(i don't know...)
Re: vb.net 2003 setup project doesn't works on another sqlserver
In your connectionstring you might have used a Server Name to connect to a database on that server. And when you deploy you application, how are you making sure that the user will also have the SQL Server with the same name.
You should read this from MSDN.
Introduction to Dynamic Properties This should clear most the confusion that you might be having regarding my previous post.
Re: vb.net 2003 setup project doesn't works on another sqlserver
Quote:
Originally Posted by laxano82
sorry because i'm new to that where is the appconfig file????
App.Config File
Re: vb.net 2003 setup project doesn't works on another sqlserver
If your talking about SQL SErver and not the MSDE then your client will need to purchase SQL Server and possibly some CALs.
Re: vb.net 2003 setup project doesn't works on another sqlserver
we have purchased a new sqlserver!!!
i have changed my appconfig file
Code:
?xml version="1.0" encoding="windows-1253"?>
<configuration>
<appSettings>
<!-- User application and configured property settings go here.-->
<!-- Example: <add key="settingName" value="settingValue"/> -->
<add key="OledbConnection1.ConnectionString" value="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=Fortotika;Data Source=team18;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;"></add>
<add key="sqlConnection1.ConnectionString" value="workstation id=STAMELMA;packet size=4096;integrated security=SSPI;data source=team18;persist security info=False;initial catalog=Fortotika"></add>
<add key="sqlConnection2.ConnectionString" value="workstation id=STAMELMA;packet size=4096;integrated security=SSPI;data source=team18;persist security info=False;initial catalog=Fortotika"></add>
</appSettings>
</configuration>
and in my form i have written
Code:
Me.OleDbConnection1.ConnectionString = CType(System.Configuration.ConfigurationSettings.AppSettings.GetValues("OledbConnection1.ConnectionString")
(i found that in the msdn link above)
but the ctype does not work because the converting into type is not declared!!!
i have put string but it doesnt work...
any ideas?????
Re: vb.net 2003 setup project doesn't work on another sqlserver
i found the mistake!!
it works if you write
Code:
Me.OleDbConnection1.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings("Oledbconnection1.ConnectionString")
you don't need the ctype()
thank you both!!!!