Solved

Conection string to sql server

Posted on 2006-10-30
17
326 Views
Last Modified: 2011-09-20
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"
0
Comment
Question by:edo60
  • 7
  • 5
  • 4
  • +1
17 Comments
 

Author Comment

by:edo60
ID: 17838026
sorry is From visual basic.net the code
0
 
LVL 10

Expert Comment

by:jnhorst
ID: 17838235
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
0
 

Author Comment

by:edo60
ID: 17838269
I pass that step
but now i have this error message under VB.net


Excepción no controlada del tipo 'System.ObjectDisposedException' en system.windows.forms.dll

Información adicional: Cannot access a disposed object named "frmStatus".
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 10

Expert Comment

by:jnhorst
ID: 17838330
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
0
 

Author Comment

by:edo60
ID: 17838424
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
0
 
LVL 10

Expert Comment

by:jnhorst
ID: 17838498
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
0
 

Author Comment

by:edo60
ID: 17838543
ok
I'm going to do it
Thank you
0
 
LVL 12

Accepted Solution

by:
sandip132 earned 250 total points
ID: 17838990
MSDE_CONNECTION_STRING  is only if that program dont get connection to SQL server.

If your local sql server is "server2" Then use this

Protected Const SQL_CONNECTION_STRING As String = _
        "Server=server2;" & _
        "DataBase=Northwind;" & _
        "Integrated Security=SSPI;Connect Timeout=5"
0
 
LVL 12

Expert Comment

by:sandip132
ID: 17839483
dont forget to add :
user=;pwd=; (if any)
0
 
LVL 10

Expert Comment

by:jnhorst
ID: 17839492
If the connection string has "Integrated Security=SSPI" there is no need for "user=...;pwd=..."

John
0
 
LVL 12

Expert Comment

by:sandip132
ID: 17839865
oops! Agreed.
0
 
LVL 12

Expert Comment

by:renjurdevan
ID: 17840400
you can find connection string from

www.connectionstring.com

0
 
LVL 12

Expert Comment

by:sandip132
ID: 17840697
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
0
 

Author Comment

by:edo60
ID: 17842914
i think yes it is the conecction string, cos in the local machine works well
I'm gona try your suggestions guys
0
 

Author Comment

by:edo60
ID: 17843030

What does this mean you guys


Excepción no controlada del tipo 'System.ObjectDisposedException' en system.windows.forms.dll

Información adicional: Cannot access a disposed object named "frmStatus".
0
 
LVL 10

Expert Comment

by:jnhorst
ID: 17843432
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
0
 

Author Comment

by:edo60
ID: 17843447
Ok you guys, is the connection string, its done, thank you so much
ernesto
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question