Click to See Complete Forum and Search --> : [RESOLVED]vb.net 2003 setup project doesn't work on another sqlserver
laxano82
Feb 3rd, 2006, 07:41 AM
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:
Shuja Ali
Feb 3rd, 2006, 07:44 AM
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.
laxano82
Feb 3rd, 2006, 07:52 AM
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...)
Shuja Ali
Feb 3rd, 2006, 08:01 AM
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 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriintroductiontoapplicationsettingstorage.asp) This should clear most the confusion that you might be having regarding my previous post.
Hack
Feb 3rd, 2006, 09:30 AM
sorry because i'm new to that where is the appconfig file????App.Config File (http://www.codeproject.com/aspnet/ConfigSections.asp)
RobDog888
Feb 3rd, 2006, 09:40 AM
If your talking about SQL SErver and not the MSDE then your client will need to purchase SQL Server and possibly some CALs.
laxano82
Feb 6th, 2006, 03:07 AM
we have purchased a new sqlserver!!!
i have changed my appconfig file
?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
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?????
laxano82
Feb 6th, 2006, 03:47 AM
i found the mistake!!
it works if you write
Me.OleDbConnection1.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings("Oledbconnection1.ConnectionString")
you don't need the ctype()
thank you both!!!!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.