Solved

Conection string to sql server

Posted on 2006-10-30
17
330 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
[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: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
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: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

Technology Partners: 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!

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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