Solved

Conection string to sql server

Posted on 2006-10-30
17
325 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
In ASP.NET using C# with .Net Framework 4.0, can a checkbox be placed in a footer? 2 56
JavaScript error 1 52
Entity Framework 3 46
Resolve Dependency Issues 4 41
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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

939 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now