Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Monday, March 26, 2012

Pooling Connection Object

Hello:

How does one pool a connection object? I have the same application running
on 4 different machines, all connecting to the same server/SQL Server 2000
instance for DB activity.

Some posts have mentioned pooling the connection objects to reduce overhead,
but how do I do that for the 4 separate computers.

Appreciate any response.

Regards,

Ryan Kennedy
Ryan P. Kennedy wrote:

> Hello:
> How does one pool a connection object? I have the same application running
> on 4 different machines, all connecting to the same server/SQL Server 2000
> instance for DB activity.
> Some posts have mentioned pooling the connection objects to reduce overhead,
> but how do I do that for the 4 separate computers.
> Appreciate any response.

You would want to connect your four applications to a single middle tier
process, which remained running, and which maintained one or more open
connections to the DBMS. The middle tier process would act as a proxy for
your client applications, receiving requests, and sending them to the
DBMS via a perpetually-kept connection, and then relaying the returns from
the DBMS to the clients.
A pooled connection can only live as long as the client that made it.
There are two main savings from pooled connections: They save the typically
longer time it takes to make a new connection, and they can be used to
limit the number of simultaneously open DBMS connections, in cases where
licensing or performance dictate that you cannot make a separate connection
for each client.
Joe Weinstein at BEA
> Regards,
>
> Ryan Kennedy

Wednesday, March 21, 2012

PLZZ HELP ! ERROR CONNECTING TO SQL SERVER

Hello everybody

i am getting problem in connecting my asp.net(c#) web application with Sql Server 2000 programatically on the page load of my web form

I wrote following code in the page load

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page
SqlConnection myConnection = new SqlConnection("server=(local);database=master;Integrated Security=SSPI");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from emp", myConnection);

DataSet ds = new DataSet();
myCommand.Fill(ds, "emp");

DataGrid1.DataSource=ds.Tables["emp"].DefaultView;
DataGrid1.DataBind();
}

Build OK but following exception occurred:

Server Error in '/datagridtest' Application.
------------------------

Login failed for user 'MATRIX\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'MATRIX\ASPNET'.

Source Error:

Line 27:
Line 28: DataSet ds = new DataSet();
Line 29: myCommand.Fill(ds, "emp"); //THIS APPEARS IN RED ON THE PAGE
Line 30:
Line 31: DataGrid1.DataSource=ds.Tables["emp"].DefaultView;

----------------------------
PLZ HELP ME, I THINK THE PROBLEM IS WITH CONNECTIONSTRING, I STUCK UP HERE FROM LAST 3 DAYS AND COULD NOT PROCEED WITH MY FURTHER STUDY AND PRACTICE

THANX IN ADVANCE

BSSGlad you got this worked out!view post 806235

Tuesday, March 20, 2012

Plz help me SQL 2005 ( Attach database File .mdf )

when i try to attach file there is an error occur
" An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified) "
Plz help me i try all things
Enable remote connections on the instance of SQL Server that you want
to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL
Server and to the SQL Server Browser service
but still error occur
Plz help me
*** Sent via Developersdex http://www.codecomments.com ***
Are you able to connect to SQL Server Management studio and exeute simple
queries like SP_WHO and all?
If no; then verify the network connectivity from host to server.
Thanks
Hari
"hossam mohamed" <hosshoss2@.yahoo.com> wrote in message
news:umAN$vEBHHA.2140@.TK2MSFTNGP02.phx.gbl...
> when i try to attach file there is an error occur
> " An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005, this failure may be caused by the
> fact that under the default settings SQL Server does not allow remote
> connections. (provider: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified) "
>
> Plz help me i try all things
> . Enable remote connections on the instance of SQL Server that you want
> to connect to from a remote computer.
> . Turn on the SQL Server Browser service.
> . Configure the firewall to allow network traffic that is related to SQL
> Server and to the SQL Server Browser service
>
> but still error occur
> Plz help me
> *** Sent via Developersdex http://www.codecomments.com ***

Plz help me SQL 2005 ( Attach database File .mdf )

when i try to attach file there is an error occur
" An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified) "
Plz help me i try all things
Enable remote connections on the instance of SQL Server that you want
to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL
Server and to the SQL Server Browser service
but still error occur
Plz help me
*** Sent via Developersdex http://www.codecomments.com ***Are you able to connect to SQL Server Management studio and exeute simple
queries like SP_WHO and all?
If no; then verify the network connectivity from host to server.
Thanks
Hari
"hossam mohamed" <hosshoss2@.yahoo.com> wrote in message
news:umAN$vEBHHA.2140@.TK2MSFTNGP02.phx.gbl...
> when i try to attach file there is an error occur
> " An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005, this failure may be caused by the
> fact that under the default settings SQL Server does not allow remote
> connections. (provider: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified) "
>
> Plz help me i try all things
> . Enable remote connections on the instance of SQL Server that you want
> to connect to from a remote computer.
> . Turn on the SQL Server Browser service.
> . Configure the firewall to allow network traffic that is related to SQL
> Server and to the SQL Server Browser service
>
> but still error occur
> Plz help me
> *** Sent via Developersdex http://www.codecomments.com ***

Saturday, February 25, 2012

Please Help. Connecting To Server

Hi All,

I have been trawling the net to find a decent example of a way to connect to an sql 2000 server using asp.net and run a few commands.

One of the commands i need to run is: "EXEC sp_addlogin 'Albert', 'B1r12-36', 'forum2'"

Please, please, please could someone show me how to do this, and display a 'successful' message on the page if the command completed successfully...i will be eternally greatful.Hi,

This article might help:
Writing and Using Stored Procedures

Regards,|||Sorry to be thick, but after viewing that page i am still stuck.

I am not sure how to actualy connect to the server. The examples on that page show connecting to a specific database using 'trusted connections' , but what i want to do is really connect to the server using a username/password and run commands like, CREATE DATABASE.

If you could spare the time to knock up some code for me, i would be most greatful, and will even load some $ into a paypal account if you have one, just for the effort.