Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Tuesday, March 27, 2012

Considerations... Backing up IIS 6 web files and SQL Server 2005 Express database

Anyone know of a good "free" way to back up web files and SQL Server 2005 Express Database?

I was able to use Windows Server 2003 Backup utility to back up the folder where the Databases were stored, as well as the web files, with no errors.

But I have heard a lot of discussion that you can't just simply backup SQL Server data files?

I'm wondering how sound the backup I've created is...

Any suggestions?

Try the link below to dowload the eval version of the full SQL Server 2005 it is good for 180 days so you have to buy the developer edition which is $60 or less later. Install it as a named instance and register the Express so you can use the backup and restore wizard to backup your databases. You don't need any third party tool to backup SQL Server if your databases are less than 1000. Hope this helps.

http://www.microsoft.com/sql/downloads/trial-software.mspx

Sunday, March 25, 2012

Connetion VS2003 C# Web Service to Sql Server 2005 Express

Hi,

I'm reaching the end of my tether here. I'm writing a Web Service application for my MCAD course in VS2003 which will connect to a SQL Server 2005 Express instance to access data. I can connect to the instance through the management suite, and through Visual Studio 2003. For some reason, when I try and manually connect through the web service, I get a page cannot be displayed error. When debugging, it falls over at the connection code. Here's what I have:

<appSettings>

<add key="ConnectionString" value="Integrated Security=SSPI;Initial Catalog=OfficeSupplies;Data Source=SGODRICH\SQLEXPRESS;"/>

</appSettings>

in web.config, and in my application:

// Create a connection to SQL Server Express

connection = new SqlConnection(ConnectionInfo);

// Upload Customer data to DataTable

dataadapter1 = new SqlDataAdapter("select * from Customers", connection);

dataadapter1.MissingSchemaAction = MissingSchemaAction.AddWithKey;

Customer_Data = new DataTable("Customers");

dataadapter1.Fill(Customer_Data);

The line in red is where the application falls over and I get a page cannot be displayed error. Any ideas why my application can't connect yet I can through both the manager and the IDE? I have enabled TCP, named pipes and shared memory. I have TCP dynamic port of 1053, I can connect using SQLCMD -S.\SQLEXPRESS from the command prompt (I get a 1> when I do this). I also have both services up and running. Anyone have any idea?

If the error happens in the red line, then your connection string is wrong. The error occurs in the constructor of the sqlconnection class not during connection which would be the .Open() method.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||Ooops. My apologies. I guess working so close to a problem blinds you to its issues. Its working fine now. Well, for now...

Connectivity Issues - Bizzare

I am trying to connect to a default instance of SQL Server 2000 Enterprise on
a remote network server using ADO.NET objects through ASP.NET Web Application.
The SQL SERVER is on a Windows XP machine (no firewall enabled) with TCP/IP
and Named Pipes enabled
For the test purposes, I created a new Web Form, created a new SqlConnection
in the Server Explorer to the remote database. I test the connection is VS
IDE and everything is fine. I create a SqlDataAdapter on the web form,
generate a dataset, test the dataset and the results are valid. I bind the
SqlDataAdapter to a datagrid and run the webform. I now get the following
error.
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at DBConnTest.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\dbconntest\webform1.aspx.cs:lin e 39
Hmph! I take the same connection string from the web app, create a win app.
Place a datagrid on the form, do the binding and load the app. Hey Presto! it
works.
I used TCPView (systeminternals.com) and I can see aspnet_wp trying to
create a connection, but its at though SQL Server is rejecting the
connection, although I see no failures in SQL Server.
Any thoughts would be much appreciated.
Andy
Sounds like firewall to me.
As a quick test to see if firewall is blocking port, try this from command
prompt on client machine ->
telnet mysqlmachine 1433
If you can't telnet to 1433, then you have firewall issue.
Matt Neerincx [MSFT]
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Andy Furnival" <AndyFurnival@.discussions.microsoft.com> wrote in message
news:40AC00C0-0402-452B-AAC8-F25D97E94ACD@.microsoft.com...
>I am trying to connect to a default instance of SQL Server 2000 Enterprise
>on
> a remote network server using ADO.NET objects through ASP.NET Web
> Application.
> The SQL SERVER is on a Windows XP machine (no firewall enabled) with
> TCP/IP
> and Named Pipes enabled
> For the test purposes, I created a new Web Form, created a new
> SqlConnection
> in the Server Explorer to the remote database. I test the connection is VS
> IDE and everything is fine. I create a SqlDataAdapter on the web form,
> generate a dataset, test the dataset and the results are valid. I bind the
> SqlDataAdapter to a datagrid and run the webform. I now get the following
> error.
> System.Data.SqlClient.SqlException: SQL Server does not exist or access
> denied.
> at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
> isInTransaction)
> at
> System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
> options, Boolean& isInTransaction)
> at System.Data.SqlClient.SqlConnection.Open()
> at DBConnTest.WebForm1.Page_Load(Object sender, EventArgs e) in
> c:\inetpub\wwwroot\dbconntest\webform1.aspx.cs:lin e 39
> Hmph! I take the same connection string from the web app, create a win
> app.
> Place a datagrid on the form, do the binding and load the app. Hey Presto!
> it
> works.
> I used TCPView (systeminternals.com) and I can see aspnet_wp trying to
> create a connection, but its at though SQL Server is rejecting the
> connection, although I see no failures in SQL Server.
> Any thoughts would be much appreciated.
> Andy

Thursday, March 22, 2012

Connectivity Issues - Bizzare

I am trying to connect to a default instance of SQL Server 2000 Enterprise o
n
a remote network server using ADO.NET objects through ASP.NET Web Applicatio
n.
The SQL SERVER is on a Windows XP machine (no firewall enabled) with TCP/IP
and Named Pipes enabled
For the test purposes, I created a new Web Form, created a new SqlConnection
in the Server Explorer to the remote database. I test the connection is VS
IDE and everything is fine. I create a SqlDataAdapter on the web form,
generate a dataset, test the dataset and the results are valid. I bind the
SqlDataAdapter to a datagrid and run the webform. I now get the following
error.
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at DBConnTest.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\dbconntest\webform1.aspx.cs:line 39
Hmph! I take the same connection string from the web app, create a win app.
Place a datagrid on the form, do the binding and load the app. Hey Presto! i
t
works.
I used TCPView (systeminternals.com) and I can see aspnet_wp trying to
create a connection, but its at though SQL Server is rejecting the
connection, although I see no failures in SQL Server.
Any thoughts would be much appreciated.
AndySounds like firewall to me.
As a quick test to see if firewall is blocking port, try this from command
prompt on client machine ->
telnet mysqlmachine 1433
If you can't telnet to 1433, then you have firewall issue.
Matt Neerincx [MSFT]
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Andy Furnival" <AndyFurnival@.discussions.microsoft.com> wrote in message
news:40AC00C0-0402-452B-AAC8-F25D97E94ACD@.microsoft.com...
>I am trying to connect to a default instance of SQL Server 2000 Enterprise
>on
> a remote network server using ADO.NET objects through ASP.NET Web
> Application.
> The SQL SERVER is on a Windows XP machine (no firewall enabled) with
> TCP/IP
> and Named Pipes enabled
> For the test purposes, I created a new Web Form, created a new
> SqlConnection
> in the Server Explorer to the remote database. I test the connection is VS
> IDE and everything is fine. I create a SqlDataAdapter on the web form,
> generate a dataset, test the dataset and the results are valid. I bind the
> SqlDataAdapter to a datagrid and run the webform. I now get the following
> error.
> System.Data.SqlClient.SqlException: SQL Server does not exist or access
> denied.
> at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
> isInTransaction)
> at
> System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConn
ectionString
> options, Boolean& isInTransaction)
> at System.Data.SqlClient.SqlConnection.Open()
> at DBConnTest.WebForm1.Page_Load(Object sender, EventArgs e) in
> c:\inetpub\wwwroot\dbconntest\webform1.aspx.cs:line 39
> Hmph! I take the same connection string from the web app, create a win
> app.
> Place a datagrid on the form, do the binding and load the app. Hey Presto!
> it
> works.
> I used TCPView (systeminternals.com) and I can see aspnet_wp trying to
> create a connection, but its at though SQL Server is rejecting the
> connection, although I see no failures in SQL Server.
> Any thoughts would be much appreciated.
> Andy

Connectivity Issues

We’re having a problem with our web applications connecting to the SQL DB
virtual server cluster. We are running SQL 2000 an '03 Server Cluster. The
front-end web servers are Win2K, IIS 5. The web servers and the database
server reside on the same LAN and the front end can ping the backend using
either IP or SQL cluster name successfully.
The clustering is functioning properly and has passed all failover testing
scenarios including the SQL Server resources. The ASP code is using a
Globaldb include file to point to a production database. When I point any of
3 web servers to a single SQL server offering the same exact databases,
users, logins, etc., IE makes the connections with no problem. When
attempting to do the same to the clustered virtual server, we get either a
“500 Internal Server” error or a blank page that says “Done” on the IE status
bar at the bottom of the window. No connection to the database is completed
Is there something we are missing to make this connection work? What can I
look at?
Thank you very much.
Apply MDAC 2.8 to all your client machines. Early versions of MDAC were not
instance aware. Cluster names (VitrualServerName\InstanceName) use the same
syntax as multi-instance SQL servers and look the same on an network.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Fonkberry" <Fonkberry@.discussions.microsoft.com> wrote in message
news:296ABC73-4A0B-44BC-8221-F5498C903DDD@.microsoft.com...
> We're having a problem with our web applications connecting to the SQL DB
> virtual server cluster. We are running SQL 2000 an '03 Server Cluster. The
> front-end web servers are Win2K, IIS 5. The web servers and the database
> server reside on the same LAN and the front end can ping the backend using
> either IP or SQL cluster name successfully.
> The clustering is functioning properly and has passed all failover testing
> scenarios including the SQL Server resources. The ASP code is using a
> Globaldb include file to point to a production database. When I point any
of
> 3 web servers to a single SQL server offering the same exact databases,
> users, logins, etc., IE makes the connections with no problem. When
> attempting to do the same to the clustered virtual server, we get either a
> "500 Internal Server" error or a blank page that says "Done" on the IE
status
> bar at the bottom of the window. No connection to the database is
completed
> Is there something we are missing to make this connection work? What can I
> look at?
> Thank you very much.
>

ConnectionString using SQL Server

Hello all,

I tried several connectionstrings in web.config file shown below and got this error "Application Error" (ErrorPage.htm).

<add name="ClubSiteDB" connectionString="Data Source=myClubs;Initial Catalog=Clubs;User Id=xxxx;Password=xxxx;" providerName="System.Data.SqlClient"/>
<add name="ClubSiteDB" connectionString="Driver={SQL Server};Server=localhost;Database=clubs;Uid=xxxx;Pwd=xxxx;" providerName="System.Data.SqlClient"/>

I created SQL Server 2000 database called clubs and ODBC DSN called myClubs at web hosting. It worked at local machine with no problem, but transfer from local machine to web hosting is something I'm not familiar with. Please advice. Thanks.

EagleGolf

check out www.connectionstrings.com|||

Hi!,

U have to specify the server name rather than 'localhost', if u r using trusted connection then it should be:
Database=Test;Server=Machine1;Trusted_Connection=Yes,
If not then specify the Userid and password:
server=Machine1;database=test;uid=xxx;pwd=xxx

Hope this will help
Regards

|||

The server name would be the url connected to the database. Or just the name like .\SQLEXPRESS? I use your method and it didn't work like it should.

|||

Hi,

Are u using SQL Express? If yes, then check this URL:

http://www.eggheadcafe.com/articles/20060719.asp

Hope this will help.

Regards

|||

I finally figured it out. I had the server name wrong and now it is corrected. Thanks for all of your help. Have a nice day.

Tuesday, March 20, 2012

connections not closed by app

we inherited this java web app that uses a jdbc-odbc bridge for connecting
to 2 sql server 2000 instances. there are probably hundreds of places in
the application where connections are not being closed (resultsets and
statements not being closed as well).
my question:
1) i assume that as DBAs you would all frown on this? do you have
suggestions about doing something on the db side to address this?
2) what i though was something like: does sql server automatically (or can
i make it) close connections after a peroid of time? would that work?Dont know that I would actually do this, but if all else fails:
1; sp_who2 into a temp table
2; have a cursor loop through the LastBatch column, using dynamic sql, and
KILL everything > 5 minutes. (Or whatever time you decide on.)
I would really try to exhaust all other resources before using this method,
just an idea to keep in mind in case you get this deperate.
--
TIA,
ChrisR
"usenetjb" wrote:
> we inherited this java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?
>|||Wow. The program must be fixed but for now, I would consider setting up a
schedule to reboot the server at night.
"usenetjb" <usenet.20.jimbo-black@.antichef.net> wrote in message
news:Xns97335385B8126usenetjb@.207.115.17.102...
> we inherited this java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?|||"Grant" <email@.nowhere.com> wrote in
news:uUcMfmzBGHA.3572@.TK2MSFTNGP14.phx.gbl:
> Wow. The program must be fixed but for now, I would consider setting
> up a schedule to reboot the server at night.
>
>
wow is not what i said, but then again ... believe it or not the app has
to be up 24/7. so we generally reboot the box after a week to make the app
speed up, sigh. it is leaking resources all over the place on the java app
side.
anyway, can sql server reboot itself? do you have any suggestions in terms
of tools to automate this sql server reboot?
thx

connections not closed by app

we inherited this Java web app that uses a jdbc-odbc bridge for connecting
to 2 sql server 2000 instances. there are probably hundreds of places in
the application where connections are not being closed (resultsets and
statements not being closed as well).
my question:
1) i assume that as DBAs you would all frown on this? do you have
suggestions about doing something on the db side to address this?
2) what i though was something like: does sql server automatically (or can
i make it) close connections after a peroid of time? would that work?Dont know that I would actually do this, but if all else fails:
1; sp_who2 into a temp table
2; have a cursor loop through the LastBatch column, using dynamic sql, and
KILL everything > 5 minutes. (Or whatever time you decide on.)
I would really try to exhaust all other resources before using this method,
just an idea to keep in mind in case you get this deperate.
TIA,
ChrisR
"usenetjb" wrote:

> we inherited this Java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?
>|||Wow. The program must be fixed but for now, I would consider setting up a
schedule to reboot the server at night.
"usenetjb" <usenet.20.jimbo-black@.antichef.net> wrote in message
news:Xns97335385B8126usenetjb@.207.115.17.102...
> we inherited this Java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?|||"Grant" <email@.nowhere.com> wrote in
news:uUcMfmzBGHA.3572@.TK2MSFTNGP14.phx.gbl:

> Wow. The program must be fixed but for now, I would consider setting
> up a schedule to reboot the server at night.
>
>
wow is not what i said, but then again ... believe it or not the app has
to be up 24/7. so we generally reboot the box after a week to make the app
speed up, sigh. it is leaking resources all over the place on the Java app
side.
anyway, can sql server reboot itself? do you have any suggestions in terms
of tools to automate this sql server reboot?
thx

connections not closed by app

we inherited this java web app that uses a jdbc-odbc bridge for connecting
to 2 sql server 2000 instances. there are probably hundreds of places in
the application where connections are not being closed (resultsets and
statements not being closed as well).
my question:
1) i assume that as DBAs you would all frown on this? do you have
suggestions about doing something on the db side to address this?
2) what i though was something like: does sql server automatically (or can
i make it) close connections after a peroid of time? would that work?
Dont know that I would actually do this, but if all else fails:
1; sp_who2 into a temp table
2; have a cursor loop through the LastBatch column, using dynamic sql, and
KILL everything > 5 minutes. (Or whatever time you decide on.)
I would really try to exhaust all other resources before using this method,
just an idea to keep in mind in case you get this deperate.
TIA,
ChrisR
"usenetjb" wrote:

> we inherited this java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?
>
|||Wow. The program must be fixed but for now, I would consider setting up a
schedule to reboot the server at night.
"usenetjb" <usenet.20.jimbo-black@.antichef.net> wrote in message
news:Xns97335385B8126usenetjb@.207.115.17.102...
> we inherited this java web app that uses a jdbc-odbc bridge for connecting
> to 2 sql server 2000 instances. there are probably hundreds of places in
> the application where connections are not being closed (resultsets and
> statements not being closed as well).
> my question:
> 1) i assume that as DBAs you would all frown on this? do you have
> suggestions about doing something on the db side to address this?
> 2) what i though was something like: does sql server automatically (or can
> i make it) close connections after a peroid of time? would that work?
|||"Grant" <email@.nowhere.com> wrote in
news:uUcMfmzBGHA.3572@.TK2MSFTNGP14.phx.gbl:

> Wow. The program must be fixed but for now, I would consider setting
> up a schedule to reboot the server at night.
>
>
wow is not what i said, but then again ... believe it or not the app has
to be up 24/7. so we generally reboot the box after a week to make the app
speed up, sigh. it is leaking resources all over the place on the java app
side.
anyway, can sql server reboot itself? do you have any suggestions in terms
of tools to automate this sql server reboot?
thx

Connections Limit?

Hi,

I have an application with a DAL that has an interface with SQL Server.
The application has 400 users that open the web forms.
My question is:
Is there a limit of the parallel connections that can be opened? Or the IIS is managing all the access to the DB? Should I worry about the performance Or it's normal behaviour for ASP.NET applications?

Thanks::The application has 400 users that open the web forms.

No, it does not. It has 25 users concurrently per processor, maximum. Unless you play around with the settings, this is the number of workther threads ASP.NET utilizes.

::Or the IIS is managing all the access to the DB?

It is, but you musth avea programming error, because the number should never go higher than 25 per processor.

You are not, by chance, not closing the connections?sqlsql

Monday, March 19, 2012

Connections

Hello everyone,
I am configuring the connection pooling for my web application.
We are using Sql Server 2000 as backend.
I need to specify initial connection poolsize and maximum connectionpoolsiz
e.
My question is how many connections can we make simultaneously to SQL server
2000.
Experts if u can give me an optimal configuration for this it will be really
helpful
ThanksWe have left the max worker threads as the default 255 in the sql server 200
0.
But we expect 300 to 500 users to connect to the application,
can we increase the max worker threads to 500
and specify the initial connection poolsize as 500 in the conection pool of
the application.
Any help would be greatly appreciated.
Thanks
"Toby" wrote:

> Hello everyone,
> I am configuring the connection pooling for my web application.
> We are using Sql Server 2000 as backend.
> I need to specify initial connection poolsize and maximum connectionpools
ize.
> My question is how many connections can we make simultaneously to SQL serv
er
> 2000.
> Experts if u can give me an optimal configuration for this it will be real
ly
> helpful
> Thanks|||Unless you have 500 simultaneous, persistent, user connections (win9x
clients), there is no need to increase the max worker threads. Sqlserver is
designed to handle thousand of connections with 255 max worker threads fine.
Long story short, your users connect to sqlserver via a web application
(running on IIS?). There isn't a need to increase the #.
-oj
"Toby" <Toby@.discussions.microsoft.com> wrote in message
news:81AE8280-C6F3-4082-8047-AD1953FF13F6@.microsoft.com...[vbcol=seagreen]
> We have left the max worker threads as the default 255 in the sql server
> 2000.
> But we expect 300 to 500 users to connect to the application,
> can we increase the max worker threads to 500
> and specify the initial connection poolsize as 500 in the conection pool
> of
> the application.
> Any help would be greatly appreciated.
> Thanks
> "Toby" wrote:
>

Connections

Hello everyone,
I am configuring the connection pooling for my web application.
We are using Sql Server 2000 as backend.
I need to specify initial connection poolsize and maximum connectionpoolsize.
My question is how many connections can we make simultaneously to SQL server
2000.
Experts if u can give me an optimal configuration for this it will be really
helpful
ThanksWe have left the max worker threads as the default 255 in the sql server 2000.
But we expect 300 to 500 users to connect to the application,
can we increase the max worker threads to 500
and specify the initial connection poolsize as 500 in the conection pool of
the application.
Any help would be greatly appreciated.
Thanks
"Toby" wrote:
> Hello everyone,
> I am configuring the connection pooling for my web application.
> We are using Sql Server 2000 as backend.
> I need to specify initial connection poolsize and maximum connectionpoolsize.
> My question is how many connections can we make simultaneously to SQL server
> 2000.
> Experts if u can give me an optimal configuration for this it will be really
> helpful
> Thanks|||Unless you have 500 simultaneous, persistent, user connections (win9x
clients), there is no need to increase the max worker threads. Sqlserver is
designed to handle thousand of connections with 255 max worker threads fine.
Long story short, your users connect to sqlserver via a web application
(running on IIS?). There isn't a need to increase the #.
--
-oj
"Toby" <Toby@.discussions.microsoft.com> wrote in message
news:81AE8280-C6F3-4082-8047-AD1953FF13F6@.microsoft.com...
> We have left the max worker threads as the default 255 in the sql server
> 2000.
> But we expect 300 to 500 users to connect to the application,
> can we increase the max worker threads to 500
> and specify the initial connection poolsize as 500 in the conection pool
> of
> the application.
> Any help would be greatly appreciated.
> Thanks
> "Toby" wrote:
>> Hello everyone,
>> I am configuring the connection pooling for my web application.
>> We are using Sql Server 2000 as backend.
>> I need to specify initial connection poolsize and maximum
>> connectionpoolsize.
>> My question is how many connections can we make simultaneously to SQL
>> server
>> 2000.
>> Experts if u can give me an optimal configuration for this it will be
>> really
>> helpful
>> Thanks

Sunday, March 11, 2012

Connection to SQL Server database

I keep on getting an error when I try to connect to my database throuh my ASP.NET WEb application. The error says login failed for user...

Initially I was using Windows Authentication with Impersonation turned on. This let me connect to the database no problem.

However, I decided to change my method of connecting to the database for performance reasons but now I get this error.

I store my connection string in web.config and it looks like this:


<appSettings>
<add key="ConnectionString" value="server=server;
Database=dbname;Connect Timeout=15;Network Library=dbmssocn;uid=username;password=userpassword"/>
</appSettings>

Further down in the web.config file I still have this:


<authentication mode="Windows" /
<authorization>
<allow users="nameofusergroup" />
<deny users="?" />
</authorization
<identity impersonate="true" />

Any ideas why I would be able to connect to the database using impersonation and not when I explicity give the crudentials in the connection string?

Regards

Wallaceprobably SQL Server isn't configured for SQL Authentication. just windows.

Connection to SQL Server 2005 Express?

Hi all, I've been reading other posts for awhile now and I can't figure out what I'm doing wrong.
I'm a Web Developer and not a DBA. I have SQL Server 2005 Express installed on my machine and it's working just fine. I also have the Management Studio Express CTP installed and working.
I'm trying to connect to a database using a username and password (from ColdFusion Server which is working fine for external Oracle and Access databases, so that's not an issue), so I set up the server to allow mixed mode authentication. I can log in to the Management Studio using Windows authentication OR the username and password without any issues.
I have TCP/IP enabled in the Configuration Manager and 127.0.0.1 enabled.
This seems like a ridiculous question, but I need to know the servername, port, username and password to connect to the database. I'm trying all combinations of things but nothing's working.
If I put in 127.0.0.1 as the server, 1433 as the port, and use the username and password that worked in Management Studio I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
If I use MACHINENAME\SQLEXPRESS I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
That makes me think I'm on the right track with 127.0.0.1 but what should I do at this point?
Edit: I have also tried to connect to my local SQL Server Express via the Migration Assistant. If I use 127.0.0.1 I get this:
Connection to SQL Server failed.
Please make sure that TCP/IP protocl is enabled on your target server and its TCP port is not blocked by a firewall.
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I'm really at a loss and I wish I knew more about this. Thanks for any advice!Try one of two things:

(1) Instead of port 1433 specify the port obtained from SQL Server Configuration Manager: SQL Server 2005 Network Configuration -> Protocols fro SQLEXPRESS -> TCP/IP -> Properties -> IP Addresses -> IP All -> TCP Dynamic Ports.

(2) Start the SQL Browser service, and specify the server as MACHINENAME\SQLEXPRESS.|||Were you able to find a solution to this issue? I'm having the same problem.

Rob|||No, unfortunately I still can't get it to work. I've moved to another testing environment with SQL Server 2000 and that's working fine. If you find a way to get this to work I'm very interested!|||Peter is the man! First off, in SQL Server Config Manager, under Network Config. Found that TCP/IP was Disabled. Once enabled, I had to restart my instance, then got the TCP Dynamic Port - plugged that into Cold Fusion Administrator and BOOYAH!

No need to muck with the server as MACHINENAME\SQLEXPRESS, I left it blank (default to 127.0.0.1).

Thanks!
|||Is the port being blocked by Firewall. If yes, then the port needs to be opened explicitly.|||I am able to connect to my sqlexpress instance from a machine with sqlserver 2003 but not from a similar machine with sqlserver 2000. I have done the stuff listed above and still cant get an udl to work. There are no intervenig firewalls as the non-connecting machines are on the same subnet. Anybody got another guess.

|||

I had the same problem, and yes it is now working.

If you are using SQL EXPRESS 2005 here it is:

Open SQL Serve Configuration Manager

under SQL Server 2005 Network configuration, click on Protocole for SQLEXPRESS, then TCP/IP, right-click on it and go in properties. Select the IP adresses Tab, at the bottom you gonna see IPALL - check what is your TCP DYNAMIC PORTS, For me the port number is 2711.

In CF Administrator I have put server 127.0.0.1 and the port 2711 and everything work fine.

Hope this help

|||

The solutions here worked for me.

Just be sure you have looked at webacadie's post above. Also be sure you have the sqlserver browser service and the database service both running... My problem was I didn't have the browser service running.

|||I still can't get this thing to connect.
I went through all the suggestions in this forum and still I cannot connect with SQLEXRESS, so far this db has been the most difficult to connect to that I have encountered.

|||

Hi les_ihs,

I'm sorry that you're having so much problems getting connections to work. Perhaps this information contained within this blog posting may help: http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx.

Thanks,

Il-Sung.

|||I had the exact same problem. The confusing part for me was the fact that it says "SQLServer 2000 JDBC driver" while I was using SQL Server 2005.

In the end all I had to do was Start the SQL Server Browser service. (which required me to first change its start mode...). A few hours of my time wasted trying to solve this problem...could have all been avoided if the SQL Server Migration Assistant I was trying to connect with had decent documentation.

Connection to SQL Server 2005 Express?

Hi all, I've been reading other posts for awhile now and I can't figure out what I'm doing wrong.
I'm a Web Developer and not a DBA. I have SQL Server 2005 Express installed on my machine and it's working just fine. I also have the Management Studio Express CTP installed and working.
I'm trying to connect to a database using a username and password (from ColdFusion Server which is working fine for external Oracle and Access databases, so that's not an issue), so I set up the server to allow mixed mode authentication. I can log in to the Management Studio using Windows authentication OR the username and password without any issues.
I have TCP/IP enabled in the Configuration Manager and 127.0.0.1 enabled.
This seems like a ridiculous question, but I need to know the servername, port, username and password to connect to the database. I'm trying all combinations of things but nothing's working.
If I put in 127.0.0.1 as the server, 1433 as the port, and use the username and password that worked in Management Studio I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
If I use MACHINENAME\SQLEXPRESS I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
That makes me think I'm on the right track with 127.0.0.1 but what should I do at this point?
Edit: I have also tried to connect to my local SQL Server Express via the Migration Assistant. If I use 127.0.0.1 I get this:
Connection to SQL Server failed.
Please make sure that TCP/IP protocl is enabled on your target server and its TCP port is not blocked by a firewall.
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I'm really at a loss and I wish I knew more about this. Thanks for any advice!Try one of two things:

(1) Instead of port 1433 specify the port obtained from SQL Server Configuration Manager: SQL Server 2005 Network Configuration -> Protocols fro SQLEXPRESS -> TCP/IP -> Properties -> IP Addresses -> IP All -> TCP Dynamic Ports.

(2) Start the SQL Browser service, and specify the server as MACHINENAME\SQLEXPRESS.|||Were you able to find a solution to this issue? I'm having the same problem.

Rob|||No, unfortunately I still can't get it to work. I've moved to another testing environment with SQL Server 2000 and that's working fine. If you find a way to get this to work I'm very interested!|||Peter is the man! First off, in SQL Server Config Manager, under Network Config. Found that TCP/IP was Disabled. Once enabled, I had to restart my instance, then got the TCP Dynamic Port - plugged that into Cold Fusion Administrator and BOOYAH!

No need to muck with the server as MACHINENAME\SQLEXPRESS, I left it blank (default to 127.0.0.1).

Thanks!
|||Is the port being blocked by Firewall. If yes, then the port needs to be opened explicitly.|||I am able to connect to my sqlexpress instance from a machine with sqlserver 2003 but not from a similar machine with sqlserver 2000. I have done the stuff listed above and still cant get an udl to work. There are no intervenig firewalls as the non-connecting machines are on the same subnet. Anybody got another guess.

|||

I had the same problem, and yes it is now working.

If you are using SQL EXPRESS 2005 here it is:

Open SQL Serve Configuration Manager

under SQL Server 2005 Network configuration, click on Protocole for SQLEXPRESS, then TCP/IP, right-click on it and go in properties. Select the IP adresses Tab, at the bottom you gonna see IPALL - check what is your TCP DYNAMIC PORTS, For me the port number is 2711.

In CF Administrator I have put server 127.0.0.1 and the port 2711 and everything work fine.

Hope this help

|||

The solutions here worked for me.

Just be sure you have looked at webacadie's post above. Also be sure you have the sqlserver browser service and the database service both running... My problem was I didn't have the browser service running.

|||I still can't get this thing to connect.
I went through all the suggestions in this forum and still I cannot connect with SQLEXRESS, so far this db has been the most difficult to connect to that I have encountered.

|||

Hi les_ihs,

I'm sorry that you're having so much problems getting connections to work. Perhaps this information contained within this blog posting may help: http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx.

Thanks,

Il-Sung.

|||I had the exact same problem. The confusing part for me was the fact that it says "SQLServer 2000 JDBC driver" while I was using SQL Server 2005.

In the end all I had to do was Start the SQL Server Browser service. (which required me to first change its start mode...). A few hours of my time wasted trying to solve this problem...could have all been avoided if the SQL Server Migration Assistant I was trying to connect with had decent documentation.

Connection to SQL Server 2005 Express?

Hi all, I've been reading other posts for awhile now and I can't figure out what I'm doing wrong.
I'm a Web Developer and not a DBA. I have SQL Server 2005 Express installed on my machine and it's working just fine. I also have the Management Studio Express CTP installed and working.
I'm trying to connect to a database using a username and password (from ColdFusion Server which is working fine for external Oracle and Access databases, so that's not an issue), so I set up the server to allow mixed mode authentication. I can log in to the Management Studio using Windows authentication OR the username and password without any issues.
I have TCP/IP enabled in the Configuration Manager and 127.0.0.1 enabled.
This seems like a ridiculous question, but I need to know the servername, port, username and password to connect to the database. I'm trying all combinations of things but nothing's working.
If I put in 127.0.0.1 as the server, 1433 as the port, and use the username and password that worked in Management Studio I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
If I use MACHINENAME\SQLEXPRESS I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
That makes me think I'm on the right track with 127.0.0.1 but what should I do at this point?
Edit: I have also tried to connect to my local SQL Server Express via the Migration Assistant. If I use 127.0.0.1 I get this:
Connection to SQL Server failed.
Please make sure that TCP/IP protocl is enabled on your target server and its TCP port is not blocked by a firewall.
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I'm really at a loss and I wish I knew more about this. Thanks for any advice!Try one of two things:

(1) Instead of port 1433 specify the port obtained from SQL Server Configuration Manager: SQL Server 2005 Network Configuration -> Protocols fro SQLEXPRESS -> TCP/IP -> Properties -> IP Addresses -> IP All -> TCP Dynamic Ports.

(2) Start the SQL Browser service, and specify the server as MACHINENAME\SQLEXPRESS.|||Were you able to find a solution to this issue? I'm having the same problem.

Rob|||No, unfortunately I still can't get it to work. I've moved to another testing environment with SQL Server 2000 and that's working fine. If you find a way to get this to work I'm very interested!|||Peter is the man! First off, in SQL Server Config Manager, under Network Config. Found that TCP/IP was Disabled. Once enabled, I had to restart my instance, then got the TCP Dynamic Port - plugged that into Cold Fusion Administrator and BOOYAH!

No need to muck with the server as MACHINENAME\SQLEXPRESS, I left it blank (default to 127.0.0.1).

Thanks!
|||Is the port being blocked by Firewall. If yes, then the port needs to be opened explicitly.|||I am able to connect to my sqlexpress instance from a machine with sqlserver 2003 but not from a similar machine with sqlserver 2000. I have done the stuff listed above and still cant get an udl to work. There are no intervenig firewalls as the non-connecting machines are on the same subnet. Anybody got another guess.

|||

I had the same problem, and yes it is now working.

If you are using SQL EXPRESS 2005 here it is:

Open SQL Serve Configuration Manager

under SQL Server 2005 Network configuration, click on Protocole for SQLEXPRESS, then TCP/IP, right-click on it and go in properties. Select the IP adresses Tab, at the bottom you gonna see IPALL - check what is your TCP DYNAMIC PORTS, For me the port number is 2711.

In CF Administrator I have put server 127.0.0.1 and the port 2711 and everything work fine.

Hope this help

|||

The solutions here worked for me.

Just be sure you have looked at webacadie's post above. Also be sure you have the sqlserver browser service and the database service both running... My problem was I didn't have the browser service running.

|||I still can't get this thing to connect.
I went through all the suggestions in this forum and still I cannot connect with SQLEXRESS, so far this db has been the most difficult to connect to that I have encountered.

|||

Hi les_ihs,

I'm sorry that you're having so much problems getting connections to work. Perhaps this information contained within this blog posting may help: http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx.

Thanks,

Il-Sung.

|||I had the exact same problem. The confusing part for me was the fact that it says "SQLServer 2000 JDBC driver" while I was using SQL Server 2005.

In the end all I had to do was Start the SQL Server Browser service. (which required me to first change its start mode...). A few hours of my time wasted trying to solve this problem...could have all been avoided if the SQL Server Migration Assistant I was trying to connect with had decent documentation.

Connection to SQL Server 2005 Express?

Hi all, I've been reading other posts for awhile now and I can't figure out what I'm doing wrong.
I'm a Web Developer and not a DBA. I have SQL Server 2005 Express installed on my machine and it's working just fine. I also have the Management Studio Express CTP installed and working.
I'm trying to connect to a database using a username and password (from ColdFusion Server which is working fine for external Oracle and Access databases, so that's not an issue), so I set up the server to allow mixed mode authentication. I can log in to the Management Studio using Windows authentication OR the username and password without any issues.
I have TCP/IP enabled in the Configuration Manager and 127.0.0.1 enabled.
This seems like a ridiculous question, but I need to know the servername, port, username and password to connect to the database. I'm trying all combinations of things but nothing's working.
If I put in 127.0.0.1 as the server, 1433 as the port, and use the username and password that worked in Management Studio I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect

The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
If I use MACHINENAME\SQLEXPRESS I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.

The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
That makes me think I'm on the right track with 127.0.0.1 but what should I do at this point?
Edit: I have also tried to connect to my local SQL Server Express via the Migration Assistant. If I use 127.0.0.1 I get this:
Connection to SQL Server failed.

Please make sure that TCP/IP protocl is enabled on your target server and its TCP port is not blocked by a firewall.

[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I'm really at a loss and I wish I knew more about this. Thanks for any advice!Try one of two things:

(1) Instead of port 1433 specify the port obtained from SQL Server Configuration Manager: SQL Server 2005 Network Configuration -> Protocols fro SQLEXPRESS -> TCP/IP -> Properties -> IP Addresses -> IP All -> TCP Dynamic Ports.

(2) Start the SQL Browser service, and specify the server as MACHINENAME\SQLEXPRESS.|||Were you able to find a solution to this issue? I'm having the same problem.

Rob|||No, unfortunately I still can't get it to work. I've moved to another testing environment with SQL Server 2000 and that's working fine. If you find a way to get this to work I'm very interested!|||Peter is the man! First off, in SQL Server Config Manager, under Network Config. Found that TCP/IP was Disabled. Once enabled, I had to restart my instance, then got the TCP Dynamic Port - plugged that into Cold Fusion Administrator and BOOYAH!

No need to muck with the server as MACHINENAME\SQLEXPRESS, I left it blank (default to 127.0.0.1).

Thanks!|||Is the port being blocked by Firewall. If yes, then the port needs to be opened explicitly.|||I am able to connect to my sqlexpress instance from a machine with sqlserver 2003 but not from a similar machine with sqlserver 2000. I have done the stuff listed above and still cant get an udl to work. There are no intervenig firewalls as the non-connecting machines are on the same subnet. Anybody got another guess.|||

I had the same problem, and yes it is now working.

If you are using SQL EXPRESS 2005 here it is:

Open SQL Serve Configuration Manager

under SQL Server 2005 Network configuration, click on Protocole for SQLEXPRESS, then TCP/IP, right-click on it and go in properties. Select the IP adresses Tab, at the bottom you gonna see IPALL - check what is your TCP DYNAMIC PORTS, For me the port number is 2711.

In CF Administrator I have put server 127.0.0.1 and the port 2711 and everything work fine.

Hope this help

|||

The solutions here worked for me.

Just be sure you have looked at webacadie's post above. Also be sure you have the sqlserver browser service and the database service both running... My problem was I didn't have the browser service running.

|||I still can't get this thing to connect.
I went through all the suggestions in this forum and still I cannot connect with SQLEXRESS, so far this db has been the most difficult to connect to that I have encountered.|||

Hi les_ihs,

I'm sorry that you're having so much problems getting connections to work. Perhaps this information contained within this blog posting may help: http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx.

Thanks,

Il-Sung.

|||I had the exact same problem. The confusing part for me was the fact that it says "SQLServer 2000 JDBC driver" while I was using SQL Server 2005.

In the end all I had to do was Start the SQL Server Browser service. (which required me to first change its start mode...). A few hours of my time wasted trying to solve this problem...could have all been avoided if the SQL Server Migration Assistant I was trying to connect with had decent documentation.

Connection to SQL Server 2005 Express?

Hi all, I've been reading other posts for awhile now and I can't figure out what I'm doing wrong.
I'm a Web Developer and not a DBA. I have SQL Server 2005 Express installed on my machine and it's working just fine. I also have the Management Studio Express CTP installed and working.
I'm trying to connect to a database using a username and password (from ColdFusion Server which is working fine for external Oracle and Access databases, so that's not an issue), so I set up the server to allow mixed mode authentication. I can log in to the Management Studio using Windows authentication OR the username and password without any issues.
I have TCP/IP enabled in the Configuration Manager and 127.0.0.1 enabled.
This seems like a ridiculous question, but I need to know the servername, port, username and password to connect to the database. I'm trying all combinations of things but nothing's working.
If I put in 127.0.0.1 as the server, 1433 as the port, and use the username and password that worked in Management Studio I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect

The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
If I use MACHINENAME\SQLEXPRESS I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.

The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
That makes me think I'm on the right track with 127.0.0.1 but what should I do at this point?
Edit: I have also tried to connect to my local SQL Server Express via the Migration Assistant. If I use 127.0.0.1 I get this:
Connection to SQL Server failed.

Please make sure that TCP/IP protocl is enabled on your target server and its TCP port is not blocked by a firewall.

[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I'm really at a loss and I wish I knew more about this. Thanks for any advice!Try one of two things:

(1) Instead of port 1433 specify the port obtained from SQL Server Configuration Manager: SQL Server 2005 Network Configuration -> Protocols fro SQLEXPRESS -> TCP/IP -> Properties -> IP Addresses -> IP All -> TCP Dynamic Ports.

(2) Start the SQL Browser service, and specify the server as MACHINENAME\SQLEXPRESS.|||Were you able to find a solution to this issue? I'm having the same problem.

Rob|||No, unfortunately I still can't get it to work. I've moved to another testing environment with SQL Server 2000 and that's working fine. If you find a way to get this to work I'm very interested!|||Peter is the man! First off, in SQL Server Config Manager, under Network Config. Found that TCP/IP was Disabled. Once enabled, I had to restart my instance, then got the TCP Dynamic Port - plugged that into Cold Fusion Administrator and BOOYAH!

No need to muck with the server as MACHINENAME\SQLEXPRESS, I left it blank (default to 127.0.0.1).

Thanks!|||Is the port being blocked by Firewall. If yes, then the port needs to be opened explicitly.|||I am able to connect to my sqlexpress instance from a machine with sqlserver 2003 but not from a similar machine with sqlserver 2000. I have done the stuff listed above and still cant get an udl to work. There are no intervenig firewalls as the non-connecting machines are on the same subnet. Anybody got another guess.|||

I had the same problem, and yes it is now working.

If you are using SQL EXPRESS 2005 here it is:

Open SQL Serve Configuration Manager

under SQL Server 2005 Network configuration, click on Protocole for SQLEXPRESS, then TCP/IP, right-click on it and go in properties. Select the IP adresses Tab, at the bottom you gonna see IPALL - check what is your TCP DYNAMIC PORTS, For me the port number is 2711.

In CF Administrator I have put server 127.0.0.1 and the port 2711 and everything work fine.

Hope this help

|||

The solutions here worked for me.

Just be sure you have looked at webacadie's post above. Also be sure you have the sqlserver browser service and the database service both running... My problem was I didn't have the browser service running.

|||I still can't get this thing to connect.
I went through all the suggestions in this forum and still I cannot connect with SQLEXRESS, so far this db has been the most difficult to connect to that I have encountered.|||

Hi les_ihs,

I'm sorry that you're having so much problems getting connections to work. Perhaps this information contained within this blog posting may help: http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx.

Thanks,

Il-Sung.

|||I had the exact same problem. The confusing part for me was the fact that it says "SQLServer 2000 JDBC driver" while I was using SQL Server 2005.

In the end all I had to do was Start the SQL Server Browser service. (which required me to first change its start mode...). A few hours of my time wasted trying to solve this problem...could have all been avoided if the SQL Server Migration Assistant I was trying to connect with had decent documentation.

Connection to SQL Server 2005 Express?

Hi all, I've been reading other posts for awhile now and I can't figure out what I'm doing wrong.
I'm a Web Developer and not a DBA. I have SQL Server 2005 Express installed on my machine and it's working just fine. I also have the Management Studio Express CTP installed and working.
I'm trying to connect to a database using a username and password (from ColdFusion Server which is working fine for external Oracle and Access databases, so that's not an issue), so I set up the server to allow mixed mode authentication. I can log in to the Management Studio using Windows authentication OR the username and password without any issues.
I have TCP/IP enabled in the Configuration Manager and 127.0.0.1 enabled.
This seems like a ridiculous question, but I need to know the servername, port, username and password to connect to the database. I'm trying all combinations of things but nothing's working.
If I put in 127.0.0.1 as the server, 1433 as the port, and use the username and password that worked in Management Studio I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
If I use MACHINENAME\SQLEXPRESS I get this:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
That makes me think I'm on the right track with 127.0.0.1 but what should I do at this point?
Edit: I have also tried to connect to my local SQL Server Express via the Migration Assistant. If I use 127.0.0.1 I get this:
Connection to SQL Server failed.
Please make sure that TCP/IP protocl is enabled on your target server and its TCP port is not blocked by a firewall.
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I'm really at a loss and I wish I knew more about this. Thanks for any advice!Try one of two things:

(1) Instead of port 1433 specify the port obtained from SQL Server Configuration Manager: SQL Server 2005 Network Configuration -> Protocols fro SQLEXPRESS -> TCP/IP -> Properties -> IP Addresses -> IP All -> TCP Dynamic Ports.

(2) Start the SQL Browser service, and specify the server as MACHINENAME\SQLEXPRESS.|||Were you able to find a solution to this issue? I'm having the same problem.

Rob|||No, unfortunately I still can't get it to work. I've moved to another testing environment with SQL Server 2000 and that's working fine. If you find a way to get this to work I'm very interested!|||Peter is the man! First off, in SQL Server Config Manager, under Network Config. Found that TCP/IP was Disabled. Once enabled, I had to restart my instance, then got the TCP Dynamic Port - plugged that into Cold Fusion Administrator and BOOYAH!

No need to muck with the server as MACHINENAME\SQLEXPRESS, I left it blank (default to 127.0.0.1).

Thanks!
|||Is the port being blocked by Firewall. If yes, then the port needs to be opened explicitly.|||I am able to connect to my sqlexpress instance from a machine with sqlserver 2003 but not from a similar machine with sqlserver 2000. I have done the stuff listed above and still cant get an udl to work. There are no intervenig firewalls as the non-connecting machines are on the same subnet. Anybody got another guess.

|||

I had the same problem, and yes it is now working.

If you are using SQL EXPRESS 2005 here it is:

Open SQL Serve Configuration Manager

under SQL Server 2005 Network configuration, click on Protocole for SQLEXPRESS, then TCP/IP, right-click on it and go in properties. Select the IP adresses Tab, at the bottom you gonna see IPALL - check what is your TCP DYNAMIC PORTS, For me the port number is 2711.

In CF Administrator I have put server 127.0.0.1 and the port 2711 and everything work fine.

Hope this help

|||

The solutions here worked for me.

Just be sure you have looked at webacadie's post above. Also be sure you have the sqlserver browser service and the database service both running... My problem was I didn't have the browser service running.

|||I still can't get this thing to connect.
I went through all the suggestions in this forum and still I cannot connect with SQLEXRESS, so far this db has been the most difficult to connect to that I have encountered.

|||

Hi les_ihs,

I'm sorry that you're having so much problems getting connections to work. Perhaps this information contained within this blog posting may help: http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx.

Thanks,

Il-Sung.

|||I had the exact same problem. The confusing part for me was the fact that it says "SQLServer 2000 JDBC driver" while I was using SQL Server 2005.

In the end all I had to do was Start the SQL Server Browser service. (which required me to first change its start mode...). A few hours of my time wasted trying to solve this problem...could have all been avoided if the SQL Server Migration Assistant I was trying to connect with had decent documentation.

Thursday, March 8, 2012

Connection to SQL Server

Hello,

I have a web application that queries data from a SQL Server. For develoment, I used integrated security to connect to the database. Now, I would like to put the application on a server and connect to the SQL Server using a username/password.

Here is my connection string


"data source=CHRISANNE;initial catalog=TAPTest;uid=TapWEBUser;pwd=myPassword"

When I attempt to connect to the SQL Server, I get the following error:
Connection failed:
SQLState: '28000'
SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'TapWEBUser'

The user profile was created and was added to the database with public, db_datareader, and db_datawriter permissions. I'm not sure what I am doing wrong. Does anyone have any suggestions? Thanks in advance!

TimCan you login to the database using that user name and password using Query Analyzer? I would try "User ID" rather than "uid". I do not see uid in the documentation.|||I attempted to login to the database using the Query Analyzer...no luck.

I recieved the following error.

Msg 18456, Level 16, State 1
Login failed for user 'TapWEBUser'

Also, I changed the uid to User ID....also no luck. Any more suggestions? Thanks.|||Well, then TapWEBUser is not set up correctly, or you are using the wrong password, or some combination. Until you can log into Query Analyzer, you have a SQL user problem unrelated to ASP.NET.

I would try and reset the users password and give it another shot.|||Ok...thanks for the advise. I found the problem. The dba gave me the wrong password.

Thanks for your help.