Welcome Guest Search | Active Topics | Log In | Register

What's the connection for SQL 2005 on my local machine? Options · View
xuanvu
#1 Posted : Wednesday, May 14, 2008 12:41:00 AM
Rank: Member


Joined: 10/14/2007
Posts: 13
Location: Denver
Hi all,
I don't know what to use for the connection string to connect to my SQL 2005 on my local machine. I've created a DB and add a Login user to the db, but I can't seems to get the connection to work. This is a different connection string that I've used for local testing:

<add name="myConnectionString" connectionString="Data Source=KENNYV;AttachDbFilename=&quot;C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\Notesnhac.mdf&quot;;Integrated Security=True" providerName="System.Data.SqlClient"/>

This works for my app. This is what I've used for YAF forum:
<connstr>user id=yaf_user;pwd=password;data source=KennyV\Kenny;initial catalog=Notesnhac;timeout=90</connstr>

Where "yaf_user" and "password" are login information. "KennyV\Kenny" is my SQL instance. When I run the install/default.aspx page, I got timed out error.

Thanks,
Kenny.
test2005
#2 Posted : Thursday, May 15, 2008 12:27:10 AM

Rank: YAF MVP



Joined: 2/12/2005
Posts: 686
Location: Italy
OK, open SQL Management Studio Express (or STD, whichever). The very first thing you will see is the connection box. Your server name is the very top box.

For example, my test server is called "BOB_THE_SERVER" and my connection string looks like this..

Code:

<add name="LocalSqlServer" connectionString="Data Source=BOB_THE_SERVER;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|YAFDB.mdf" />


if you are using SQL Express, the server name should look something like...

Code:
Date Source=BOB_THE_SERVER\SQLEXPRESS


On your YAF connection string, try:

Code:
<connstr>user id=yaf_user;pwd=password;data source=KennyV\SQLEXPRESS;initial catalog=YAFDB;timeout=90</connstr>


The "catalog" parameter is the actual name you have given the YAF database.

HTH

Razz
.....the man in black fled across the desert..........and the gunslinger followed.....

xuanvu
#3 Posted : Thursday, May 15, 2008 5:41:31 PM
Rank: Member


Joined: 10/14/2007
Posts: 13
Location: Denver
Hi Razz,
That's what I did, but I got connection timed out. When I open my SQL Server Management Studio (I'm using SQL 2005 standard version), I see that my server name is KennyV, and the instance is Kenny. So I've used:

<connstr>user id=yaf_user;pwd=password;data source=KennyV\Kenny;initial catalog=Notesnhac;timeout=90</connstr>

for the connection string. Again, once I logged in to MS SQL, the "Summary" window displays:

KENNYV (SQL Server 9.0.1399 - KENNYV\Kenny

Thanks.
test2005
#4 Posted : Thursday, May 15, 2008 6:42:32 PM

Rank: YAF MVP



Joined: 2/12/2005
Posts: 686
Location: Italy
xuanvu wrote:
Hi Razz,
That's what I did, but I got connection timed out. When I open my SQL Server Management Studio (I'm using SQL 2005 standard version), I see that my server name is KennyV, and the instance is Kenny. So I've used:

<connstr>user id=yaf_user;pwd=password;data source=KennyV\Kenny;initial catalog=Notesnhac;timeout=90</connstr>

for the connection string. Again, once I logged in to MS SQL, the "Summary" window displays:

KENNYV (SQL Server 9.0.1399 - KENNYV\Kenny

Thanks.


The KENNYV\Kenny is the SQL authenticated USER, not the server instance.

In your connection string, replace "Kenny" with "SQLEXPRESS" and see what happens. If it still fails, take the "\Kenny" out (replace it with nothing) and try again.

Also, is your YAF database called "Notesnhac"? Weird!

Razz


.....the man in black fled across the desert..........and the gunslinger followed.....

xuanvu
#5 Posted : Friday, May 16, 2008 5:57:12 AM
Rank: Member


Joined: 10/14/2007
Posts: 13
Location: Denver
Thanks a lot... I tried couple times but it didn't work, so I decided to create a db on my host and just point it there. Everything seems to be working now. I have lots of questions regarding the configuration the forum with my website though, hope you can help Smile I'll post it soon.

By the way, my website is "Notesnhac", in Vietnamese, "nhac" means music. So it's basically "music notes".

Thanks again,
Kenny.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 RC1 | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.070 seconds.

SourceForge.net Logo Powered by ASP.NET v2.0 411ASP.NET