Solved

Conection string to sql server

Posted on 2006-10-30
17
323 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
Comment Utility
sorry is From visual basic.net the code
0
 
LVL 10

Expert Comment

by:jnhorst
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
ok
I'm going to do it
Thank you
0
 
LVL 12

Accepted Solution

by:
sandip132 earned 250 total points
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 12

Expert Comment

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

Expert Comment

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

John
0
 
LVL 12

Expert Comment

by:sandip132
Comment Utility
oops! Agreed.
0
 
LVL 12

Expert Comment

by:renjurdevan
Comment Utility
you can find connection string from

www.connectionstring.com

0
 
LVL 12

Expert Comment

by:sandip132
Comment Utility
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
Comment Utility
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
Comment Utility

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
Comment Utility
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
Comment Utility
Ok you guys, is the connection string, its done, thank you so much
ernesto
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

11 Experts available now in Live!

Get 1:1 Help Now