Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Monday, March 19, 2012

Database server connection

I am trying to using sqlserver as back-end for an application(web) running
on the window 2X, one thing I am not sure is that once I establish the
connection between database server and application, should I keep this
connection open while application is running, or only open it when
there is a requet to qury records from database?

Thanks for your help."Leon" <penghao98@.hotmail.com> wrote in message
news:89a0a7de.0409221926.6c394129@.posting.google.c om...
>I am trying to using sqlserver as back-end for an application(web) running
> on the window 2X, one thing I am not sure is that once I establish the
> connection between database server and application, should I keep this
> connection open while application is running, or only open it when
> there is a requet to qury records from database?
> Thanks for your help.

I believe the usual approach is to leave the connection open, to avoid the
overhead associated with opening and closing the connection again and again.
This is one reason for using connection pooling, for example.

You might want to post in a forum for your client library (eg ADO, JDBC) or
development environment (eg ASP, PHP) to see if there are any specific
considerations for your application.

Simon|||penghao98@.hotmail.com (Leon) wrote in message news:<89a0a7de.0409221926.6c394129@.posting.google.com>...
> I am trying to using sqlserver as back-end for an application(web) running
> on the window 2X, one thing I am not sure is that once I establish the
> connection between database server and application, should I keep this
> connection open while application is running, or only open it when
> there is a requet to qury records from database?
> Thanks for your help.

Hi,
This is question basically regarding connection pooling.
Which technology you are using for database acess? like ADO,JDO, JDBc
etc..?
In all these you can create a pool of connections and maintain it. So
the best thing which I feel is ,during boot up of your application
create a pool of connections, store it and use the connection when
needed.
This is purely dependent on your application also.

Some technologies like ADO and JDBC now support disconnected rowsets
also like CachedRowset in Java where internally it will(means
driver/proider) handle reconnecting to the server when a request
comes.

But from performance point of view, better to create connections
during start up.

How many connections? etc depending on the usage of your application
Regards
Zunil
Cordys

Sunday, February 19, 2012

Database problems with loging into my site

I have build a ASP.NET website with a login form. I can create an account but I am not able to login into the site. I have checked the connection string. I have changed the database folder and moved files around to get the database runing from a different folder but it still wont work. ThanksTim

Which version of ASP.NET are you working with?

Which version of SQL Server are you working with?

Try copying the contents of your connection string to a expty text file, rename the file to X.UDL and double click on it. The connection dialog should appear. Click the test button.

|||

i am using VWD 2005 Express and I am hosting it using IIS 5.1 (Windows XP) as my server. I am working on Workframe 2

Database problems

I am new to ASP.Net so I have a bunch of beginner problems here. My first BIG one is that every time I try and make a database connection in my code, I get

"Login failed for user 'sa'. Reason: Not associated with trusted SQL Server connection"

I know 'sa' is a valid user for the database, and I have retreived data other ways through swlDataAdapters, sqlConnections, and Datasets from design view. Any idea why I cannot expictitly connection to my DB in my code?? Or is there something stupid and small that I am overlooking?

Any help will be greatly appreciated.::Or is there something stupid and small that I am overlooking?

It is, but given the maount of people stumbling over it - you are not alone.

SQL Server simply is set not to look for the password but to use Windows integrated authentication ONLY. In this case access is checked against the account asp.net is running under, which has not enough security rights.

You need to reconfigure SQL Server to use mixed mode authentication, so that the username/password parts of the connection string actually have a real meaning. Especially the password part.

Friday, February 17, 2012

Database port

What port does SQL Server 2000 is using for connection ?
What I want to do is I want to connect my application from my home machine
to my office server, so I need to open the port in my office server.
Do I need to have VPN in order to connect over the internet ?Alan,
On the Microsoft SQL Server group select Server Network Utility, select
TCP/IP and click Properties. You will see the default port (usually 1433).
Ben Nevarez, MCDBA, OCP
Database Administrator
"Alan" wrote:

> What port does SQL Server 2000 is using for connection ?
> What I want to do is I want to connect my application from my home machine
> to my office server, so I need to open the port in my office server.
> Do I need to have VPN in order to connect over the internet ?
>
>|||Sorry, I can't find the Server Network Utility.
"Ben Nevarez" <bnevarez@.sjm.com> wrote in message
news:C2A4874D-96D8-4ABD-BAFD-C0B657C7F437@.microsoft.com...[vbcol=seagreen]
> Alan,
> On the Microsoft SQL Server group select Server Network Utility, select
> TCP/IP and click Properties. You will see the default port (usually 1433).
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "Alan" wrote:
>
machine[vbcol=seagreen]|||Alan wrote:
> What port does SQL Server 2000 is using for connection ?
> What I want to do is I want to connect my application from my home machine
> to my office server, so I need to open the port in my office server.
> Do I need to have VPN in order to connect over the internet ?
>
By default SQL server is using port 1433 so you'll have to have that
open. I'd strongly recommend that you use a VPN connection. Otherwise
you'll open your server to everyone and I doubt that's what you want...:-).
Regards
Steen Schlter Persson
Databaseadministrator / Systemadministrator|||It is in the SQL Server Program group on the server machine.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Alan" <alanpltseNOSPAM@.yahoo.com.au> wrote in message
news:%235HFdHRkGHA.836@.TK2MSFTNGP02.phx.gbl...
> Sorry, I can't find the Server Network Utility.
> "Ben Nevarez" <bnevarez@.sjm.com> wrote in message
> news:C2A4874D-96D8-4ABD-BAFD-C0B657C7F437@.microsoft.com...
> machine
>|||Alan,
On the Microsoft SQL Server group select Server Network Utility, select
TCP/IP and click Properties. You will see the default port (usually 1433).
Ben Nevarez, MCDBA, OCP
Database Administrator
"Alan" wrote:

> What port does SQL Server 2000 is using for connection ?
> What I want to do is I want to connect my application from my home machine
> to my office server, so I need to open the port in my office server.
> Do I need to have VPN in order to connect over the internet ?
>
>|||Sorry, I can't find the Server Network Utility.
"Ben Nevarez" <bnevarez@.sjm.com> wrote in message
news:C2A4874D-96D8-4ABD-BAFD-C0B657C7F437@.microsoft.com...[vbcol=seagreen]
> Alan,
> On the Microsoft SQL Server group select Server Network Utility, select
> TCP/IP and click Properties. You will see the default port (usually 1433).
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "Alan" wrote:
>
machine[vbcol=seagreen]|||Alan wrote:
> What port does SQL Server 2000 is using for connection ?
> What I want to do is I want to connect my application from my home machine
> to my office server, so I need to open the port in my office server.
> Do I need to have VPN in order to connect over the internet ?
>
By default SQL server is using port 1433 so you'll have to have that
open. I'd strongly recommend that you use a VPN connection. Otherwise
you'll open your server to everyone and I doubt that's what you want...:-).
Regards
Steen Schlter Persson
Databaseadministrator / Systemadministrator|||It is in the SQL Server Program group on the server machine.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Alan" <alanpltseNOSPAM@.yahoo.com.au> wrote in message
news:%235HFdHRkGHA.836@.TK2MSFTNGP02.phx.gbl...
> Sorry, I can't find the Server Network Utility.
> "Ben Nevarez" <bnevarez@.sjm.com> wrote in message
> news:C2A4874D-96D8-4ABD-BAFD-C0B657C7F437@.microsoft.com...
> machine
>|||Steen Persson (DK) wrote:
> Alan wrote:
> By default SQL server is using port 1433 so you'll have to have that
> open. I'd strongly recommend that you use a VPN connection. Otherwise
> you'll open your server to everyone and I doubt that's what you want...:-)
.
>
Hopefully the server is behind an existing firewall. If VPN isn't an
option, use the firewall rules to open port 1433, but only allow
connections from the IP address of your home machine. Either way, some
basic network security needs to be observed here.

Database port

What port does SQL Server 2000 is using for connection ?
What I want to do is I want to connect my application from my home machine
to my office server, so I need to open the port in my office server.
Do I need to have VPN in order to connect over the internet ?Alan,
On the Microsoft SQL Server group select Server Network Utility, select
TCP/IP and click Properties. You will see the default port (usually 1433).
Ben Nevarez, MCDBA, OCP
Database Administrator
"Alan" wrote:
> What port does SQL Server 2000 is using for connection ?
> What I want to do is I want to connect my application from my home machine
> to my office server, so I need to open the port in my office server.
> Do I need to have VPN in order to connect over the internet ?
>
>|||Sorry, I can't find the Server Network Utility.
"Ben Nevarez" <bnevarez@.sjm.com> wrote in message
news:C2A4874D-96D8-4ABD-BAFD-C0B657C7F437@.microsoft.com...
> Alan,
> On the Microsoft SQL Server group select Server Network Utility, select
> TCP/IP and click Properties. You will see the default port (usually 1433).
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "Alan" wrote:
> > What port does SQL Server 2000 is using for connection ?
> > What I want to do is I want to connect my application from my home
machine
> > to my office server, so I need to open the port in my office server.
> > Do I need to have VPN in order to connect over the internet ?
> >
> >
> >|||Alan wrote:
> What port does SQL Server 2000 is using for connection ?
> What I want to do is I want to connect my application from my home machine
> to my office server, so I need to open the port in my office server.
> Do I need to have VPN in order to connect over the internet ?
>
By default SQL server is using port 1433 so you'll have to have that
open. I'd strongly recommend that you use a VPN connection. Otherwise
you'll open your server to everyone and I doubt that's what you want...:-).
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator|||It is in the SQL Server Program group on the server machine.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Alan" <alanpltseNOSPAM@.yahoo.com.au> wrote in message
news:%235HFdHRkGHA.836@.TK2MSFTNGP02.phx.gbl...
> Sorry, I can't find the Server Network Utility.
> "Ben Nevarez" <bnevarez@.sjm.com> wrote in message
> news:C2A4874D-96D8-4ABD-BAFD-C0B657C7F437@.microsoft.com...
>> Alan,
>> On the Microsoft SQL Server group select Server Network Utility, select
>> TCP/IP and click Properties. You will see the default port (usually 1433).
>> Ben Nevarez, MCDBA, OCP
>> Database Administrator
>>
>> "Alan" wrote:
>> > What port does SQL Server 2000 is using for connection ?
>> > What I want to do is I want to connect my application from my home
> machine
>> > to my office server, so I need to open the port in my office server.
>> > Do I need to have VPN in order to connect over the internet ?
>> >
>> >
>> >
>|||Steen Persson (DK) wrote:
> Alan wrote:
>> What port does SQL Server 2000 is using for connection ?
>> What I want to do is I want to connect my application from my home
>> machine
>> to my office server, so I need to open the port in my office server.
>> Do I need to have VPN in order to connect over the internet ?
>>
> By default SQL server is using port 1433 so you'll have to have that
> open. I'd strongly recommend that you use a VPN connection. Otherwise
> you'll open your server to everyone and I doubt that's what you want...:-).
>
Hopefully the server is behind an existing firewall. If VPN isn't an
option, use the firewall rules to open port 1433, but only allow
connections from the IP address of your home machine. Either way, some
basic network security needs to be observed here.|||I used netstat -a to list
but what should I looking at ?
Local Address or Foreign Address ?
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:OTgxdVUkGHA.976@.TK2MSFTNGP02.phx.gbl...
> Steen Persson (DK) wrote:
>> Alan wrote:
>> What port does SQL Server 2000 is using for connection ?
>> What I want to do is I want to connect my application from my home
>> machine
>> to my office server, so I need to open the port in my office server.
>> Do I need to have VPN in order to connect over the internet ?
>>
>> By default SQL server is using port 1433 so you'll have to have that
>> open. I'd strongly recommend that you use a VPN connection. Otherwise
>> you'll open your server to everyone and I doubt that's what you
>> want...:-).
>>
> Hopefully the server is behind an existing firewall. If VPN isn't an
> option, use the firewall rules to open port 1433, but only allow
> connections from the IP address of your home machine. Either way, some
> basic network security needs to be observed here.|||Alan T wrote:
> I used netstat -a to list
> but what should I looking at ?
> Local Address or Foreign Address ?
>
"Local" would imply the local machine, so assuming you're running
NETSTAT on the SQL server machine, i.e. the "local" machine, you would
want the Local Address.
--
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Tuesday, February 14, 2012

Database Options

What is the real difference between setting the database
options using A SET statement which applies to the current
connection only or specifying the setting as a database-
level default with ALTER DATABASE?When the option is set at the database level, that is the default setting
for all new connections.
The Set statement overrides the DB setting however...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"van" <vandenm2@.yahoo.com> wrote in message
news:16abe01c4480f$e8afa130$a501280a@.phx.gbl...
> What is the real difference between setting the database
> options using A SET statement which applies to the current
> connection only or specifying the setting as a database-
> level default with ALTER DATABASE?|||Well, one change is temporary for the current session, the other change is
permanent?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"van" <vandenm2@.yahoo.com> wrote in message
news:16abe01c4480f$e8afa130$a501280a@.phx.gbl...
> What is the real difference between setting the database
> options using A SET statement which applies to the current
> connection only or specifying the setting as a database-
> level default with ALTER DATABASE?