Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 475
  • Last Modified:

MS SQL Server - How to find a connection string

I've got SQL Server 2005 Express installed on my computer and am trying to figure out what the connection string would be that I need to use in order to connect to it from an ASP.NET application.  I known that I cannot connect to a SQL Server Express database over a network from a different computer, but I want to be able to connect to it locally as part of a testing environment.

Is there a way in SQL Server Management Studio that I can find out what the connection string would be to a particular database?
0
josephdaviskcrm
Asked:
josephdaviskcrm
1 Solution
 
jmoss111Commented:
Hello josephdaviskcrm,

Look at www.connectionstrings.com

Regards,

Jim
0
 
lotusnotesnewbieCommented:
Your
If server is in local simply use .
connectionString="Data Source=<servername>\SQLEXPRESS;Initial Catalog=<database name>;User ID=sa;Password=<pwd>" providerName="System.Data.SqlClient" />
Or you can create a empty aspx page. Drag and drop SQLDataSource from Toolbox->Data click on New connection follow the wizard which will generate the connection string for u.
 
0
 
Marten RuneSQL Expert/Infrastructure ArchitectCommented:
Not your question but...
Quote: "I known that I cannot connect to a SQL Server Express database over a network from a different computer"

This opinion of yours needs to be updated. Of course you can connect to a SQL Express from another computer. It's just not on by default.

Go to: Programs/Microsoft SQL.../Configuration tools/SQL Server Configuration manager
Enable TCP/IP, and if you like Named pipes (needs a really stable and fast network).
I often exclude the named pipes

/Marten
0
 
josephdaviskcrmAuthor Commented:
lotusnotesnewbie:
That connection string you provided doesn't seem to work.  When I try to set up a connection with the SqlDataSource web control, the wizard says that it is able to connect to the database when I click on 'test connection', but when I hit ok to finalize it Visual Studio throws an error and I am never able to see the connection string.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now