Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Friday, March 30, 2012

Numerous event 17137 in event log

Hello,
I am using SQL SERVER 2005 EXPRESS SP1 with an ASP.NET application, and I
get an event 17137 "Starting database MyDB" at each connection to my
database, which is a very frequent event.
The problem is that the application event log of the machine is full of this
event, with the consequence on old servers like Windows 2000 to get a message
saying the log is full and you have to empty it.
I would like to know how I can turn off the logging of SQL SERVER event 17137.
--
Olivier GIL
LAFON SAOliver GIL,
Is your MyDB in AUTO_CLOSE = ON mode? If so, you can turn this OFF, thus
keeping MyDB open by:
ALTER DATABASE MyDB SET AUTO_CLOSE OFF
That should get rid of the messages and make your accesses to MyDB run more
quickly.
RLF
"Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
news:D985059D-D4CD-490B-8299-FB4924A4FF7F@.microsoft.com...
> Hello,
> I am using SQL SERVER 2005 EXPRESS SP1 with an ASP.NET application, and I
> get an event 17137 "Starting database MyDB" at each connection to my
> database, which is a very frequent event.
> The problem is that the application event log of the machine is full of
> this
> event, with the consequence on old servers like Windows 2000 to get a
> message
> saying the log is full and you have to empty it.
> I would like to know how I can turn off the logging of SQL SERVER event
> 17137.
> --
> Olivier GIL
> LAFON SA|||Hello,
AUTO_CLOSE OFF actually solves the problem.
It is surprising this option not being the default value for a CREATE
DATABASE command, knowing that the performance is better in that case.
--
Olivier GIL
LAFON SA
"Russell Fields" wrote:
> Oliver GIL,
> Is your MyDB in AUTO_CLOSE = ON mode? If so, you can turn this OFF, thus
> keeping MyDB open by:
> ALTER DATABASE MyDB SET AUTO_CLOSE OFF
> That should get rid of the messages and make your accesses to MyDB run more
> quickly.
> RLF
> "Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
> news:D985059D-D4CD-490B-8299-FB4924A4FF7F@.microsoft.com...
> > Hello,
> >
> > I am using SQL SERVER 2005 EXPRESS SP1 with an ASP.NET application, and I
> > get an event 17137 "Starting database MyDB" at each connection to my
> > database, which is a very frequent event.
> >
> > The problem is that the application event log of the machine is full of
> > this
> > event, with the consequence on old servers like Windows 2000 to get a
> > message
> > saying the log is full and you have to empty it.
> >
> > I would like to know how I can turn off the logging of SQL SERVER event
> > 17137.
> >
> > --
> > Olivier GIL
> > LAFON SA
>
>|||Hi Olivier,
Regarding your concerns, you can find the following description regarding
AUTO_CLOSE OFF in SQL Server Books Online:
AUTO_CLOSE Default Value:
ON for all databases when using Microsoft SQL Server 2000 Desktop Engine or
SQL Server 2005 Express Edition, and OFF for all other editions, regardless
of operating system.
(REF: http://msdn2.microsoft.com/en-us/library/ms190249.aspx)
"The AUTO_CLOSE option is useful for desktop databases because it allows
database files to be managed as normal files. They can be moved, copied to
make backups, or even e-mailed to other users. The AUTO_CLOSE option should
not be used for databases accessed by an application that repeatedly makes
and breaks connections to SQL Server. The overhead of closing and reopening
the database between each connection will impair performance."
(REF: http://technet.microsoft.com/en-us/library/aa933082(SQL.80).aspx)
Please feel free to let us know if you have any other questions or
concerns. Have a nice day!
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||Hello Olivier,
AUTO_CLOSE option if ON by default only for MSDE and Express Editions.
I suggest you to take a look at the following link for further info:
http://msdn2.microsoft.com/en-us/library/ms190249.aspx
--
Ekrem Ã?nsoy
"Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
news:C20E229A-83E5-4D09-9B1F-F830E84EA438@.microsoft.com...
> Hello,
> AUTO_CLOSE OFF actually solves the problem.
>
> It is surprising this option not being the default value for a CREATE
> DATABASE command, knowing that the performance is better in that case.
> --
> Olivier GIL
> LAFON SA
>
> "Russell Fields" wrote:
>> Oliver GIL,
>> Is your MyDB in AUTO_CLOSE = ON mode? If so, you can turn this OFF,
>> thus
>> keeping MyDB open by:
>> ALTER DATABASE MyDB SET AUTO_CLOSE OFF
>> That should get rid of the messages and make your accesses to MyDB run
>> more
>> quickly.
>> RLF
>> "Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
>> news:D985059D-D4CD-490B-8299-FB4924A4FF7F@.microsoft.com...
>> > Hello,
>> >
>> > I am using SQL SERVER 2005 EXPRESS SP1 with an ASP.NET application, and
>> > I
>> > get an event 17137 "Starting database MyDB" at each connection to my
>> > database, which is a very frequent event.
>> >
>> > The problem is that the application event log of the machine is full of
>> > this
>> > event, with the consequence on old servers like Windows 2000 to get a
>> > message
>> > saying the log is full and you have to empty it.
>> >
>> > I would like to know how I can turn off the logging of SQL SERVER event
>> > 17137.
>> >
>> > --
>> > Olivier GIL
>> > LAFON SA
>>

Numerous event 17137 in event log

Hello,
I am using SQL SERVER 2005 EXPRESS SP1 with an ASP.NET application, and I
get an event 17137 "Starting database MyDB" at each connection to my
database, which is a very frequent event.
The problem is that the application event log of the machine is full of this
event, with the consequence on old servers like Windows 2000 to get a messag
e
saying the log is full and you have to empty it.
I would like to know how I can turn off the logging of SQL SERVER event 1713
7.
Olivier GIL
LAFON SAOliver GIL,
Is your MyDB in AUTO_CLOSE = ON mode? If so, you can turn this OFF, thus
keeping MyDB open by:
ALTER DATABASE MyDB SET AUTO_CLOSE OFF
That should get rid of the messages and make your accesses to MyDB run more
quickly.
RLF
"Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
news:D985059D-D4CD-490B-8299-FB4924A4FF7F@.microsoft.com...
> Hello,
> I am using SQL SERVER 2005 EXPRESS SP1 with an ASP.NET application, and I
> get an event 17137 "Starting database MyDB" at each connection to my
> database, which is a very frequent event.
> The problem is that the application event log of the machine is full of
> this
> event, with the consequence on old servers like Windows 2000 to get a
> message
> saying the log is full and you have to empty it.
> I would like to know how I can turn off the logging of SQL SERVER event
> 17137.
> --
> Olivier GIL
> LAFON SA|||Hello,
AUTO_CLOSE OFF actually solves the problem.
It is surprising this option not being the default value for a CREATE
DATABASE command, knowing that the performance is better in that case.
Olivier GIL
LAFON SA
"Russell Fields" wrote:

> Oliver GIL,
> Is your MyDB in AUTO_CLOSE = ON mode? If so, you can turn this OFF, thus
> keeping MyDB open by:
> ALTER DATABASE MyDB SET AUTO_CLOSE OFF
> That should get rid of the messages and make your accesses to MyDB run mor
e
> quickly.
> RLF
> "Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
> news:D985059D-D4CD-490B-8299-FB4924A4FF7F@.microsoft.com...
>
>|||Hi Olivier,
Regarding your concerns, you can find the following description regarding
AUTO_CLOSE OFF in SQL Server Books Online:
AUTO_CLOSE Default Value:
ON for all databases when using Microsoft SQL Server 2000 Desktop Engine or
SQL Server 2005 Express Edition, and OFF for all other editions, regardless
of operating system.
(REF: http://msdn2.microsoft.com/en-us/library/ms190249.aspx)
"The AUTO_CLOSE option is useful for desktop databases because it allows
database files to be managed as normal files. They can be moved, copied to
make backups, or even e-mailed to other users. The AUTO_CLOSE option should
not be used for databases accessed by an application that repeatedly makes
and breaks connections to SQL Server. The overhead of closing and reopening
the database between each connection will impair performance."
(REF: http://technet.microsoft.com/en-us/library/aa933082(SQL.80).aspx)
Please feel free to let us know if you have any other questions or
concerns. Have a nice day!
Best regards,
Charles Wang
Microsoft Online Community Support
========================================
=============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============|||Hello Olivier,
AUTO_CLOSE option if ON by default only for MSDE and Express Editions.
I suggest you to take a look at the following link for further info:
http://msdn2.microsoft.com/en-us/library/ms190249.aspx
Ekrem ?nsoy
"Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
news:C20E229A-83E5-4D09-9B1F-F830E84EA438@.microsoft.com...[vbcol=seagreen]
> Hello,
> AUTO_CLOSE OFF actually solves the problem.
>
> It is surprising this option not being the default value for a CREATE
> DATABASE command, knowing that the performance is better in that case.
> --
> Olivier GIL
> LAFON SA
>
> "Russell Fields" wrote:
>

Numerous event 17137 in event log

Hello,
I am using SQL SERVER 2005 EXPRESS SP1 with an ASP.NET application, and I
get an event 17137 "Starting database MyDB" at each connection to my
database, which is a very frequent event.
The problem is that the application event log of the machine is full of this
event, with the consequence on old servers like Windows 2000 to get a message
saying the log is full and you have to empty it.
I would like to know how I can turn off the logging of SQL SERVER event 17137.
Olivier GIL
LAFON SA
Oliver GIL,
Is your MyDB in AUTO_CLOSE = ON mode? If so, you can turn this OFF, thus
keeping MyDB open by:
ALTER DATABASE MyDB SET AUTO_CLOSE OFF
That should get rid of the messages and make your accesses to MyDB run more
quickly.
RLF
"Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
news:D985059D-D4CD-490B-8299-FB4924A4FF7F@.microsoft.com...
> Hello,
> I am using SQL SERVER 2005 EXPRESS SP1 with an ASP.NET application, and I
> get an event 17137 "Starting database MyDB" at each connection to my
> database, which is a very frequent event.
> The problem is that the application event log of the machine is full of
> this
> event, with the consequence on old servers like Windows 2000 to get a
> message
> saying the log is full and you have to empty it.
> I would like to know how I can turn off the logging of SQL SERVER event
> 17137.
> --
> Olivier GIL
> LAFON SA
|||Hello,
AUTO_CLOSE OFF actually solves the problem.
It is surprising this option not being the default value for a CREATE
DATABASE command, knowing that the performance is better in that case.
Olivier GIL
LAFON SA
"Russell Fields" wrote:

> Oliver GIL,
> Is your MyDB in AUTO_CLOSE = ON mode? If so, you can turn this OFF, thus
> keeping MyDB open by:
> ALTER DATABASE MyDB SET AUTO_CLOSE OFF
> That should get rid of the messages and make your accesses to MyDB run more
> quickly.
> RLF
> "Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
> news:D985059D-D4CD-490B-8299-FB4924A4FF7F@.microsoft.com...
>
>
|||Hi Olivier,
Regarding your concerns, you can find the following description regarding
AUTO_CLOSE OFF in SQL Server Books Online:
AUTO_CLOSE Default Value:
ON for all databases when using Microsoft SQL Server 2000 Desktop Engine or
SQL Server 2005 Express Edition, and OFF for all other editions, regardless
of operating system.
(REF: http://msdn2.microsoft.com/en-us/library/ms190249.aspx)
"The AUTO_CLOSE option is useful for desktop databases because it allows
database files to be managed as normal files. They can be moved, copied to
make backups, or even e-mailed to other users. The AUTO_CLOSE option should
not be used for databases accessed by an application that repeatedly makes
and breaks connections to SQL Server. The overhead of closing and reopening
the database between each connection will impair performance."
(REF: http://technet.microsoft.com/en-us/library/aa933082(SQL.80).aspx)
Please feel free to let us know if you have any other questions or
concerns. Have a nice day!
Best regards,
Charles Wang
Microsoft Online Community Support
================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
|||Hello Olivier,
AUTO_CLOSE option if ON by default only for MSDE and Express Editions.
I suggest you to take a look at the following link for further info:
http://msdn2.microsoft.com/en-us/library/ms190249.aspx
Ekrem ?nsoy
"Olivier GIL" <ogil@.newsgroup.nospam> wrote in message
news:C20E229A-83E5-4D09-9B1F-F830E84EA438@.microsoft.com...[vbcol=seagreen]
> Hello,
> AUTO_CLOSE OFF actually solves the problem.
>
> It is surprising this option not being the default value for a CREATE
> DATABASE command, knowing that the performance is better in that case.
> --
> Olivier GIL
> LAFON SA
>
> "Russell Fields" wrote:
sql

Monday, March 26, 2012

Number of SQL Queries too large?

Hi All,

I'm currently in the middle of building quite a large CMS using ASP.NET and MSSQL2K and have began to question if the amount of queries I am using for one page to be built is too many?

For one page (View Forum) I am getting all of the templates and checking access then pulling a list of threads, getting the first and last posts, then user info for the first and last posts... anyway to view 10 threads on the page the number of queries comes to about 54 and the page takes 0.064 seconds to load.

My question is, Is this to many queries to be running for a single page load? All queries are using Stored Procedures.

Thanks Guys.Hi,

Since you are using StoredProcedures, performance shouldnt be bad. However 54 queries for a page is a bit high

Did you try mingling one of these procedures within the other?

Anyway, you can try creating views and writing procedures to retrive data from them incase your queries involve table joins.

indexing your tables might be another good option. These are at the SQL Level.

Hope it helps.|||thanks for your reply,

I actually did see what would happen by pulling all the data in one request using table joins and such and it actually effected performance for the worse =(

I'm not worried about performance as it is currently as fast as I could hope, was just getting concerned about the ammount of requests to the database.

Thanks for your help =)|||Hi,

Your Welcome! As long as the page is served fast, you don't have to worry :)

Because, there will be an automatic timeout, if the executing query takes too much time.

Hope it helps.

Tuesday, March 20, 2012

Number of CAL's for SQL Server 2000 SP3 & ASP app

I need to know how many SQL Server 2000 CAL's I will need to serve an
ASP web application that will connect to our SQL Server. The
application vendor told me to ask Microsoft, so I'm asking in this
forum. Thanks in advance. The current version of the software is
written in ASP, the new version that will be coming out soon is written
in ASP.NET. Thanks.
Stewart@.UGA
One for every user who will access SQL Server through your application. If you don't have control
over this, you need to go Per Processor licensing.
http://www.microsoft.com/sql/howtobuy/faq.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Stewart Harrison" <stewharr@.uga.edu> wrote in message
news:%23O808m7LFHA.2980@.TK2MSFTNGP10.phx.gbl...
>I need to know how many SQL Server 2000 CAL's I will need to serve an ASP web application that will
>connect to our SQL Server. The application vendor told me to ask Microsoft, so I'm asking in this
>forum. Thanks in advance. The current version of the software is written in ASP, the new version
>that will be coming out soon is written in ASP.NET. Thanks.
> Stewart@.UGA
|||If it's a public-facing web app then you'll need to go for Processor
Licensing rather than Server/CAL licensing. If it's an internal app
with a known number of client users or devices then you should
determine whether Processor or CAL licensing is more cost-effective for
you. See:
http://www.microsoft.com/sql/howtobuy/default.asp
BTW note that this forum isn't "Microsoft" and I'm not a Microsoft
employee. For the definitive answer talk to a Microsoft Sales rep.
David Portas
SQL Server MVP

Number of CAL's for SQL Server 2000 SP3 & ASP app

I need to know how many SQL Server 2000 CAL's I will need to serve an
ASP web application that will connect to our SQL Server. The
application vendor told me to ask Microsoft, so I'm asking in this
forum. Thanks in advance. The current version of the software is
written in ASP, the new version that will be coming out soon is written
in ASP.NET. Thanks.
Stewart@.UGAOne for every user who will access SQL Server through your application. If y
ou don't have control
over this, you need to go Per Processor licensing.
http://www.microsoft.com/sql/howtobuy/faq.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Stewart Harrison" <stewharr@.uga.edu> wrote in message
news:%23O808m7LFHA.2980@.TK2MSFTNGP10.phx.gbl...
>I need to know how many SQL Server 2000 CAL's I will need to serve an ASP w
eb application that will
>connect to our SQL Server. The application vendor told me to ask Microsoft
, so I'm asking in this
>forum. Thanks in advance. The current version of the software is written
in ASP, the new version
>that will be coming out soon is written in ASP.NET. Thanks.
> Stewart@.UGA|||If it's a public-facing web app then you'll need to go for Processor
Licensing rather than Server/CAL licensing. If it's an internal app
with a known number of client users or devices then you should
determine whether Processor or CAL licensing is more cost-effective for
you. See:
http://www.microsoft.com/sql/howtobuy/default.asp
BTW note that this forum isn't "Microsoft" and I'm not a Microsoft
employee. For the definitive answer talk to a Microsoft Sales rep.
David Portas
SQL Server MVP
--

Number of CAL's for SQL Server 2000 SP3 & ASP app

I need to know how many SQL Server 2000 CAL's I will need to serve an
ASP web application that will connect to our SQL Server. The
application vendor told me to ask Microsoft, so I'm asking in this
forum. Thanks in advance. The current version of the software is
written in ASP, the new version that will be coming out soon is written
in ASP.NET. Thanks.
Stewart@.UGAOne for every user who will access SQL Server through your application. If you don't have control
over this, you need to go Per Processor licensing.
http://www.microsoft.com/sql/howtobuy/faq.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Stewart Harrison" <stewharr@.uga.edu> wrote in message
news:%23O808m7LFHA.2980@.TK2MSFTNGP10.phx.gbl...
>I need to know how many SQL Server 2000 CAL's I will need to serve an ASP web application that will
>connect to our SQL Server. The application vendor told me to ask Microsoft, so I'm asking in this
>forum. Thanks in advance. The current version of the software is written in ASP, the new version
>that will be coming out soon is written in ASP.NET. Thanks.
> Stewart@.UGA|||If it's a public-facing web app then you'll need to go for Processor
Licensing rather than Server/CAL licensing. If it's an internal app
with a known number of client users or devices then you should
determine whether Processor or CAL licensing is more cost-effective for
you. See:
http://www.microsoft.com/sql/howtobuy/default.asp
BTW note that this forum isn't "Microsoft" and I'm not a Microsoft
employee. For the definitive answer talk to a Microsoft Sales rep.
--
David Portas
SQL Server MVP
--

Saturday, February 25, 2012

null user login failed

I'm new to Crystal Reports and ASP and I'm sure i'm missing something simple here.

I've got a SQL server database, A Crystal Report, a VB application and an ASP Application

In the VB app i call the crystal report and log on to the database with the intergrated security

However in the ASP app i try the same and it has me log on as a null user.

what have i forgotten to do that will let the intergrated security work between SQL Server and ASPyou need to use impersonation in IIS so that IIS uses the credentials of the user, rather than of the nt account the IIS service is running as.|||Thank you i knew it was something simple i was missing

NULL SQL 2000

Maybe I'm doing something weird... but here's the problem I'm having.

I made a small ASP.NET (C#) site on my local machine that connects to SQL 2000. When I test the application it runs great. Everything gets stored into the database and the tables that it is suppose to.

I upload the site to a hosting company and when I run it, I get all sorts of error with the database. (I also copied the database from my local machine to the server via Enterprise Manager.)

For example, when I run the registration page - I get the error message:

"Cannot insert the value NULL into column 'user_id', table 'xxx.xxxx.tbl_users'; column does not allow nulls. INSERT fails. The statement has been terminated. "

I checked the table properties and my columns are set to allow null values. With the exception of having a primary key set to a column for indentity purpose (user_id).

The weird part is that I checked to see if the data are being stored into the column... and it is! Everything that was sent from the form is being stored into the table.

So I don't understand the problem I am having. Can anyone shed some light for me?

Below is the function I've written that inserts the data into the table.

===========================
C# Function to insert data
===========================

// Store Data to String

string strFirst = reg_fname.Text.ToString().Trim();
string strLast = reg_lname.Text.ToString().Trim();
string strEmail = reg_email.Text.ToString().Trim();
string strZip = reg_zip.Text.ToString().Trim();
string strCountry = reg_country.Text.ToString().Trim();

// Open Connection to Database

string strConnection = ConfigurationSettings.AppSettings["xxxxx"];

string strSQL = "INSERT INTO tbl_registration (first_name, last_name, email, zip, country) VALUES ('"+ strFirst.Replace("'", "") +"', '"+ strLast.Replace("'", "") +"', '"+ strEmail.Replace("'", "") +"', '"+ strPassword.Replace("'", "") +"', '"+ strZip.Replace("'", "") +"', '"+ strCountry.Replace("'", "") +"')";

// Execute Connection and INSERT Data

SqlConnection oConnection = new SqlConnection(strConnection);
oConnection.Open();
SqlCommand oCommand = new SqlCommand(strSQL, oConnection )oCommand.ExecuteNonQuery();

oConnection.Close();How is the user_id column populated? You mentioned "identity purposes." Is the column marked as an IDENTITY in SQL?

Regarding your command, consider using parameterized commands:


string sqlStmt;
SqlCommand cmd;

sqlStmt = "INSERT INTO (first_name, last_name, email, zip, country) VALUES (@.first_name, @.last_name, @.email, @.zip, @.country)";
cmd = new SqlCommand(sqlStmt, oConnection);
cmd.Parameters.Add("@.first_name", strFirst);
cmd.Parameters.Add("@.last_name", strLast);
cmd.Parameters.Add("@.email", strPassword);
cmd.Parameters.Add("@.zip", strZip);
cmd.Parameters.Add("@.country", strCountry);
cmd.ExecuteNonQuery();

Note that if any of the parameters contain any illegal characters, such as a single quote, the parameter will be "fixed", so the str.Replace("''", "'") is not required.|||Also, are there triggers involved? Sometimes, the error message is referring to something that your trigger was trying to do, and not the proc you were explicitly executing... :)

Null Reference Exception

I cannot seem to get the crystal reports to work in asp.net

I set the databindings source property and the report shows in the designer a little weird. In the Initialize component, i call the BindData() and when i run the app i get a NullReferenceException.

I did exactly what a walkthrough from msdn said to do and its not working.

I also tried setting a breakpoint on InitializeComponent to see what was happening, but it errors before it gets called.

Any suggestions about this NullReferenceExceptionStill need help on this one