Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Conection string to sql server

Posted on 2006-10-30
17
Medium Priority
?
334 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:Ernesto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 4
  • +1
17 Comments
 

Author Comment

by:Ernesto
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:Ernesto
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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:Ernesto
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:Ernesto
ID: 17838543
ok
I'm going to do it
Thank you
0
 
LVL 12

Accepted Solution

by:
sandip132 earned 1000 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:Ernesto
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:Ernesto
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:Ernesto
ID: 17843447
Ok you guys, is the connection string, its done, thank you so much
ernesto
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

721 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