Ernesto
asked on
Conection string to sql server
Hi all this database is not intalled in my local machine , but is in server2 how do I put the string well for conect to my server2 I try all the ways but can't done
Thank you
Ernesto
"Server=(local)\VSDotNet;" & _
"DataBase=Northwind;" & _
"Integrated Security=SSPI;Connect Timeout=5"
Thank you
Ernesto
"Server=(local)\VSDotNet;"
"DataBase=Northwind;" & _
"Integrated Security=SSPI;Connect Timeout=5"
Your "Server=..." portion should only point to the name of the server unless SQL Server has been iinstalled with a "named instance." SQL Server can be installed in one of two ways:
1) Default instance. This is the normal way. The instance name of the SQL Server is the name of the server machine.
2) Named instance. An example of this would be where the default instance is SQL Server 2000, and separate instance of SQL Server 2005 has been installed. I have this on my laptop. The default instance is my MACHINENAME. The named instance is "MACHINENAME\SQL2005".
You need to change your connection string to say "Server=<<put the machine name here>>" unless your SQL Server is a named instance. In that case it would be "Server=<<machine name/instance name>>". Everything else looks fine.
John
1) Default instance. This is the normal way. The instance name of the SQL Server is the name of the server machine.
2) Named instance. An example of this would be where the default instance is SQL Server 2000, and separate instance of SQL Server 2005 has been installed. I have this on my laptop. The default instance is my MACHINENAME. The named instance is "MACHINENAME\SQL2005".
You need to change your connection string to say "Server=<<put the machine name here>>" unless your SQL Server is a named instance. In that case it would be "Server=<<machine name/instance name>>". Everything else looks fine.
John
ASKER
I pass that step
but now i have this error message under VB.net
Excepción no controlada del tipo 'System.ObjectDisposedExce ption' en system.windows.forms.dll
Información adicional: Cannot access a disposed object named "frmStatus".
but now i have this error message under VB.net
Excepción no controlada del tipo 'System.ObjectDisposedExce
Información adicional: Cannot access a disposed object named "frmStatus".
I will need to see the code where this is happening. It looks like you are showing a form, closing it (which is where it is getting disposed) and then trying to show it again.
John
John
ASKER
Is from Visual basic "101 VB.NET Samples"
Is the one that is in the folder "VB.NET - Data Access - Data Entry Form"
If you be able to check it out
Thank you a lot
Ernesto
Is the one that is in the folder "VB.NET - Data Access - Data Entry Form"
If you be able to check it out
Thank you a lot
Ernesto
Ernesto...
You're going to need to paste your code into a post. EE experts are definitely not going to try to find "101 VB.NET Samples". I would very much like to help you get past the errors, but you'll need to put a little bit more into this for me to be able to help.
John
You're going to need to paste your code into a post. EE experts are definitely not going to try to find "101 VB.NET Samples". I would very much like to help you get past the errors, but you'll need to put a little bit more into this for me to be able to help.
John
ASKER
ok
I'm going to do it
Thank you
I'm going to do it
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dont forget to add :
user=;pwd=; (if any)
user=;pwd=; (if any)
If the connection string has "Integrated Security=SSPI" there is no need for "user=...;pwd=..."
John
John
oops! Agreed.
You can connect with this connection string also but you need to install MSDE with the Northwind database installed.
Protected Const MSDE_CONNECTION_STRING As String = _
"Server=(local)\VSDotNet;" & _
"DataBase=Northwind;" & _
"Integrated Security=SSPI;Connect Timeout=5"
For more details:
Microsoft .NET Framework SDK v1.1>Samples
Protected Const MSDE_CONNECTION_STRING As String = _
"Server=(local)\VSDotNet;"
"DataBase=Northwind;" & _
"Integrated Security=SSPI;Connect Timeout=5"
For more details:
Microsoft .NET Framework SDK v1.1>Samples
ASKER
i think yes it is the conecction string, cos in the local machine works well
I'm gona try your suggestions guys
I'm gona try your suggestions guys
ASKER
What does this mean you guys
Excepción no controlada del tipo 'System.ObjectDisposedExce
Información adicional: Cannot access a disposed object named "frmStatus".
Edo...
Most likely you have a form you are using as a dialog. The instance is being created when the dialog is shown, then disposed wjen the dialog is dismissed. If you try to show the dialog again without creating a new instance, you will get this error.
John
Most likely you have a form you are using as a dialog. The instance is being created when the dialog is shown, then disposed wjen the dialog is dismissed. If you try to show the dialog again without creating a new instance, you will get this error.
John
ASKER
Ok you guys, is the connection string, its done, thank you so much
ernesto
ernesto
ASKER