Thursday, March 29, 2012
Performance of Xsl Transformations
I've done a ton of debugging and digging around, and have come to the
conclusion that the performance issues are NOT caused by slow stored
procedures, or bad XSL/Ts.
I came to this conclusion by doing a test transformation in client-side code
instead of server side aspx, as shown at the bottom of this post. The
transformations were super-fast. However, the client-side javascript isn't a
viable solution for my application.
I'm sure that different versions of the XMLDOM are being used when the code
is client-side as opposed to using System.Xml.Xsl.
Here's my C# code. What I'm trying to do is write out an HTML file of my
transformation.
// Create a FileStream to write with
System.IO.FileStream fs = new System.IO.FileStream(exportPath,
System.IO.FileMode.Create);
// Create an XmlTextWriter for the FileStream
System.Xml.XmlTextWriter oXmlTextWriter = new
System.Xml.XmlTextWriter(fs, System.Text.Encoding.Unicode);
try
{
// Set up the XmlResolver
XmlUrlResolver oXmlUrlResolver = new XmlUrlResolver();
oXmlUrlResolver.Credentials = CredentialCache.DefaultCredentials;
// Set up the XslTransform
System.Xml.Xsl.XslTransform oXslTransform = new
System.Xml.Xsl.XslTransform();
oXslTransform.Load(MyXslPath, oXmlUrlResolver);
// Perform Transformation
XmlDataDocument oXmlDataDocument = new XmlDataDocument(MyDataSet);
oXslTransform.Transform(oXmlDataDocument, null, oXmlTextWriter,
oXmlUrlResolver);
// Clean up
oXmlTextWriter.Close();
return exportPath; // defined elsewhere
}
catch (Exception ex)
{
oXmlTextWriter.Close();
System.IO.File.Delete(exportPath);
ExceptionManager.Publish(ex);
throw(ex);
}
The code works, but it's slow. It was suggested that I use an XPathDocument
instead of an XmlDataDocument. How would I do that?
Any suggestions? Thank You
Client-Side Transformation
<%
var sXml = "MyXml.Xml"
var sXsl = "MyXsl.xsl"
var oXmlDoc = Server.CreateObject("MICROSOFT.XMLDOM");
var oXslDoc = Server.CreateObject("MICROSOFT.XMLDOM");
oXmlDoc.async = false;
oXslDoc.async = false;
oXmlDoc.load(Server.MapPath(sXml));
oXslDoc.load(Server.MapPath(sXsl));
Response.Write(oXmlDoc.transformNode(oXslDoc));
%Ok, I figured this out ... I would like to do some research to figure out
why this is faster (MUCH faster).
The slow way:
DataSet oDataSet = populate dataset with some report data
System.IO.FileStream oFileStream = new System.IO.FileStream(exportPath,
System.IO.FileMode.Create);
System.Xml.XmlTextWriter oXmlTextWriter = new
System.Xml.XmlTextWriter(oFileStream, System.Text.Encoding.Unicode);
try
{
XmlUrlResolver oXmlUrlResolver = new XmlUrlResolver();
oXmlUrlResolver.Credentials = CredentialCache.DefaultCredentials;
System.Xml.Xsl.XslTransform oXslTransform = new
System.Xml.Xsl.XslTransform();
oXslTransform.Load(_XslPath, oXmlUrlResolver);
XmlDataDocument oXmlDataDocument = new XmlDataDocument(oDataSet);
oXslTransform.Transform(oXmlDataDocument, null, oXmlTextWriter,
oXmlUrlResolver);
oXmlTextWriter.Close();
return exportPath; // path of exported file
}
catch (Exception ex)
{
oXmlTextWriter.Close();
System.IO.File.Delete(exportPath);
throw(ex);
}
The fast way:
DataSet oDataSet = populate dataset with some report data
XmlTextReader oXmlTextReader = new XmlTextReader(oDataSet.GetXml(),
XmlNodeType.Document, null);
System.IO.FileStream oFileStream = new System.IO.FileStream(exportPath,
System.IO.FileMode.Create);
System.Xml.XmlTextWriter oXmlTextWriter = new
System.Xml.XmlTextWriter(oFileStream, System.Text.Encoding.Unicode);
try
{
XmlUrlResolver oXmlUrlResolver = new XmlUrlResolver();
oXmlUrlResolver.Credentials = CredentialCache.DefaultCredentials;
System.Xml.Xsl.XslTransform oXslTransform = new
System.Xml.Xsl.XslTransform();
oXslTransform.Load(_XslPath, oXmlUrlResolver);
XPathDocument oXPathDocument = new XPathDocument(oXmlReader);
oXslTransform.Transform(oXPathDocument, null, oXmlTextWriter,
oXmlUrlResolver);
oXmlTextWriter.Close();
return exportPath; // path of exported file
}
catch (Exception ex)
{
oXmlTextWriter.Close();
System.IO.File.Delete(exportPath);
throw(ex);
}
"George Durzi" <gdurzi@.hotmail.com> wrote in message
news:#eQPvdwzDHA.1744@.TK2MSFTNGP12.phx.gbl...
> Folks, I'm running into some performance issues with my Xsl
transformations.
> I've done a ton of debugging and digging around, and have come to the
> conclusion that the performance issues are NOT caused by slow stored
> procedures, or bad XSL/Ts.
> I came to this conclusion by doing a test transformation in client-side
code
> instead of server side aspx, as shown at the bottom of this post. The
> transformations were super-fast. However, the client-side javascript isn't
a
> viable solution for my application.
> I'm sure that different versions of the XMLDOM are being used when the
code
> is client-side as opposed to using System.Xml.Xsl.
> Here's my C# code. What I'm trying to do is write out an HTML file of my
> transformation.
> // Create a FileStream to write with
> System.IO.FileStream fs = new System.IO.FileStream(exportPath,
> System.IO.FileMode.Create);
> // Create an XmlTextWriter for the FileStream
> System.Xml.XmlTextWriter oXmlTextWriter = new
> System.Xml.XmlTextWriter(fs, System.Text.Encoding.Unicode);
> try
> {
> // Set up the XmlResolver
> XmlUrlResolver oXmlUrlResolver = new XmlUrlResolver();
> oXmlUrlResolver.Credentials = CredentialCache.DefaultCredentials;
> // Set up the XslTransform
> System.Xml.Xsl.XslTransform oXslTransform = new
> System.Xml.Xsl.XslTransform();
> oXslTransform.Load(MyXslPath, oXmlUrlResolver);
> // Perform Transformation
> XmlDataDocument oXmlDataDocument = new XmlDataDocument(MyDataSet);
> oXslTransform.Transform(oXmlDataDocument, null, oXmlTextWriter,
> oXmlUrlResolver);
> // Clean up
> oXmlTextWriter.Close();
> return exportPath; // defined elsewhere
> }
> catch (Exception ex)
> {
> oXmlTextWriter.Close();
> System.IO.File.Delete(exportPath);
> ExceptionManager.Publish(ex);
> throw(ex);
> }
>
> The code works, but it's slow. It was suggested that I use an
XPathDocument
> instead of an XmlDataDocument. How would I do that?
> Any suggestions? Thank You
>
> Client-Side Transformation
> <%
> var sXml = "MyXml.Xml"
> var sXsl = "MyXsl.xsl"
> var oXmlDoc = Server.CreateObject("MICROSOFT.XMLDOM");
> var oXslDoc = Server.CreateObject("MICROSOFT.XMLDOM");
> oXmlDoc.async = false;
> oXslDoc.async = false;
> oXmlDoc.load(Server.MapPath(sXml));
> oXslDoc.load(Server.MapPath(sXsl));
> Response.Write(oXmlDoc.transformNode(oXslDoc));
> %>
Performance problems using ASP.NET 2.0
I have just built my first ASP.NET v2.0 app and have it running on a 3 server web farm that runs several other ASP.NET v1.1 apps. The v1.1 apps run great, but the new v2.0 app always seems to run very slowly when first connecting to the site, even if other users have already visited the site. I believe I have pre-compiled the site, and even if I visit each server in turn to ensure the app has been compiled before hitting the load-balanced url, the site just runs very slowly. On our development machines the site runs very quickly, so the poor performance is a bit of a mystery.
The servers in the farm are running Windows 2003 Server and the machine.config on each server has been updated to syncronize the machine keys.
Check the event viewer to see if the app pool is restarting itself. Some people had problems with the application shutting down and if that's your case then when the app (aspnet) restarts itself the code has to recompile. Any other details that you might find, will help on directing you towards the right path.hi
are u working with directory. The asp.net 2.0 application restart as soon as the directory structure changes. see the post below
http://vikramlakhotia.com/Post.aspx?postID=6
Hope this helps
Vikram
Vikram's Blog
Did not know that. If that's the case that's a huge bug on asp.net 2.0. It should be reported. Maybe there's a setting on the Machine.Config for the application not to restart when the directory structure changes.
There was nothing in the event viewer for all three servers (relating to asp.net anyway). The slow responses almost feel like every page request is causing the application to be re-built...
I don't know what else to tell you. Maybe you have indexing on and it's getting ahold of the files and thus restarting. Just throwing one out there.
Try creating another app and see how it behaves. If it behaves normal, then the problem is related to your application.
performance question
Now, I'm accessing the database via a web service and one thing i noticed
that my app is running real slow. When I first started working on the app is
ran pretty quick returned the data to the screens in about 2 - 3 seconds. Now
its going about 5 - 10 seconds. How can I beef it up for better performance.> Lets just say my app is done HOO HOO.
I hate it when my app is done HOO HOO. But what are you going to do? Live it
or live with it, as the young lady says...
;-)
Performance. This is one of the reasons why Uncle Chutney says "Big things
are made up of lots of little things." In a client-server app, this is
especially true. Small increases or decreases in performance can make a big
difference when a lot of clients are accessing a web app. Multiply the
difference in performance by the number of clients, and you can see why.
There are lots of little things you can do to dramatically increase
performance. I'll try to hit the big ones.
1. In a client-server app, any work done by the client means a big savings
on the server. The more clients the bigger the savings. Use client-side
processing and JavaScript whenever possible.
2. If your App is written in VB.Net, make sure that Option Strict is turned
ON! Late-binding is anathema to performance.
3. Avoid duplication in your app. Don't duplicate values, and don't
duplicate code. Any time you see the same few lines of code in several
places, you're looking at a good candidate for a function or Sub. If you
have created a number of classes that have the same fields, properties,
and/or methods, you're looking at a good candidate for a base class, and
derived classes.
4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
quite useful; others are one-size-fits-all memory hogs for beginners, to
make it easy for them to make something happen without much trouble.
5. Close and/or Dispose any objects that use unmanaged resources as quickly
as possible.
6. Close database connections ASAP.
On a similar note, it should be stressed that performance is a factor in
designing your app. The fastest apps have much more lower-level code in
them, and are also more proprietary overall. Writing an app that is easily
extensible may involve a trade-off of performance over code maintainability.
Striking the right balance is an art.
I'm sure I've overlooked several things, but I do believe I've hit on the
majors in this list. At any rate, I hope it helps.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:1DA19F5F-C332-4818-959F-7881D0D3A61A@.microsoft.com...
> Lets just say my app is done HOO HOO.
> Now, I'm accessing the database via a web service and one thing i noticed
> that my app is running real slow. When I first started working on the app
is
> ran pretty quick returned the data to the screens in about 2 - 3 seconds.
Now
> its going about 5 - 10 seconds. How can I beef it up for better
performance.
All good points. Actually all the db connections are closed and all the db
transactions are being done in the web service. The html(aspx) pages call the
function needed and then i do formatting on the aspx pages, such as the
datagrids.
The only question i have it the Option Strict. I turned that ON and when I
recompiled the project. I got all kinds of errors such as
Option Strict On Disallows implicit conversions from 'String' to 'Short'
how do i fix that?
"Kevin Spencer" wrote:
> > Lets just say my app is done HOO HOO.
> I hate it when my app is done HOO HOO. But what are you going to do? Live it
> or live with it, as the young lady says...
> ;-)
> Performance. This is one of the reasons why Uncle Chutney says "Big things
> are made up of lots of little things." In a client-server app, this is
> especially true. Small increases or decreases in performance can make a big
> difference when a lot of clients are accessing a web app. Multiply the
> difference in performance by the number of clients, and you can see why.
> There are lots of little things you can do to dramatically increase
> performance. I'll try to hit the big ones.
> 1. In a client-server app, any work done by the client means a big savings
> on the server. The more clients the bigger the savings. Use client-side
> processing and JavaScript whenever possible.
> 2. If your App is written in VB.Net, make sure that Option Strict is turned
> ON! Late-binding is anathema to performance.
> 3. Avoid duplication in your app. Don't duplicate values, and don't
> duplicate code. Any time you see the same few lines of code in several
> places, you're looking at a good candidate for a function or Sub. If you
> have created a number of classes that have the same fields, properties,
> and/or methods, you're looking at a good candidate for a base class, and
> derived classes.
> 4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
> quite useful; others are one-size-fits-all memory hogs for beginners, to
> make it easy for them to make something happen without much trouble.
> 5. Close and/or Dispose any objects that use unmanaged resources as quickly
> as possible.
> 6. Close database connections ASAP.
> On a similar note, it should be stressed that performance is a factor in
> designing your app. The fastest apps have much more lower-level code in
> them, and are also more proprietary overall. Writing an app that is easily
> extensible may involve a trade-off of performance over code maintainability.
> Striking the right balance is an art.
> I'm sure I've overlooked several things, but I do believe I've hit on the
> majors in this list. At any rate, I hope it helps.
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
> "Mike" <Mike@.discussions.microsoft.com> wrote in message
> news:1DA19F5F-C332-4818-959F-7881D0D3A61A@.microsoft.com...
> > Lets just say my app is done HOO HOO.
> > Now, I'm accessing the database via a web service and one thing i noticed
> > that my app is running real slow. When I first started working on the app
> is
> > ran pretty quick returned the data to the screens in about 2 - 3 seconds.
> Now
> > its going about 5 - 10 seconds. How can I beef it up for better
> performance.
>
Dim x as string = "99"
Dim y as short = CType(x, Short)
OR
Dim y as short = CShort(x)
You'll use a lot of CType with Option Strict On, but it is worth the extra
effort.
Greg
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:8AEAF9A6-319B-4298-AC79-2991C3F89A2A@.microsoft.com...
> All good points. Actually all the db connections are closed and all the db
> transactions are being done in the web service. The html(aspx) pages call
> the
> function needed and then i do formatting on the aspx pages, such as the
> datagrids.
> The only question i have it the Option Strict. I turned that ON and when I
> recompiled the project. I got all kinds of errors such as
> Option Strict On Disallows implicit conversions from 'String' to 'Short'
> how do i fix that?
> "Kevin Spencer" wrote:
>> > Lets just say my app is done HOO HOO.
>>
>> I hate it when my app is done HOO HOO. But what are you going to do? Live
>> it
>> or live with it, as the young lady says...
>>
>> ;-)
>>
>> Performance. This is one of the reasons why Uncle Chutney says "Big
>> things
>> are made up of lots of little things." In a client-server app, this is
>> especially true. Small increases or decreases in performance can make a
>> big
>> difference when a lot of clients are accessing a web app. Multiply the
>> difference in performance by the number of clients, and you can see why.
>>
>> There are lots of little things you can do to dramatically increase
>> performance. I'll try to hit the big ones.
>>
>> 1. In a client-server app, any work done by the client means a big
>> savings
>> on the server. The more clients the bigger the savings. Use client-side
>> processing and JavaScript whenever possible.
>> 2. If your App is written in VB.Net, make sure that Option Strict is
>> turned
>> ON! Late-binding is anathema to performance.
>> 3. Avoid duplication in your app. Don't duplicate values, and don't
>> duplicate code. Any time you see the same few lines of code in several
>> places, you're looking at a good candidate for a function or Sub. If you
>> have created a number of classes that have the same fields, properties,
>> and/or methods, you're looking at a good candidate for a base class, and
>> derived classes.
>> 4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
>> quite useful; others are one-size-fits-all memory hogs for beginners, to
>> make it easy for them to make something happen without much trouble.
>> 5. Close and/or Dispose any objects that use unmanaged resources as
>> quickly
>> as possible.
>> 6. Close database connections ASAP.
>>
>> On a similar note, it should be stressed that performance is a factor in
>> designing your app. The fastest apps have much more lower-level code in
>> them, and are also more proprietary overall. Writing an app that is
>> easily
>> extensible may involve a trade-off of performance over code
>> maintainability.
>> Striking the right balance is an art.
>>
>> I'm sure I've overlooked several things, but I do believe I've hit on the
>> majors in this list. At any rate, I hope it helps.
>>
>> --
>> HTH,
>> Kevin Spencer
>> ..Net Developer
>> Microsoft MVP
>> I get paid good money to
>> solve puzzles for a living
>>
>> "Mike" <Mike@.discussions.microsoft.com> wrote in message
>> news:1DA19F5F-C332-4818-959F-7881D0D3A61A@.microsoft.com...
>> > Lets just say my app is done HOO HOO.
>>> > Now, I'm accessing the database via a web service and one thing i
>> > noticed
>> > that my app is running real slow. When I first started working on the
>> > app
>> is
>> > ran pretty quick returned the data to the screens in about 2 - 3
>> > seconds.
>> Now
>> > its going about 5 - 10 seconds. How can I beef it up for better
>> performance.
>>>>
>>
>
That worked on the one error.
Now i'm getting Option Strict On disallows Late binding.
I'm doing some formatting of the datagrids based on certain data that is
returned.
How can i fix that issue now?
I need to format the grids based on the data being returned
"Greg Burns" wrote:
> Dim x as string = "99"
> Dim y as short = CType(x, Short)
> OR
> Dim y as short = CShort(x)
> You'll use a lot of CType with Option Strict On, but it is worth the extra
> effort.
> Greg
> "Mike" <Mike@.discussions.microsoft.com> wrote in message
> news:8AEAF9A6-319B-4298-AC79-2991C3F89A2A@.microsoft.com...
> > All good points. Actually all the db connections are closed and all the db
> > transactions are being done in the web service. The html(aspx) pages call
> > the
> > function needed and then i do formatting on the aspx pages, such as the
> > datagrids.
> > The only question i have it the Option Strict. I turned that ON and when I
> > recompiled the project. I got all kinds of errors such as
> > Option Strict On Disallows implicit conversions from 'String' to 'Short'
> > how do i fix that?
> > "Kevin Spencer" wrote:
> >> > Lets just say my app is done HOO HOO.
> >>
> >> I hate it when my app is done HOO HOO. But what are you going to do? Live
> >> it
> >> or live with it, as the young lady says...
> >>
> >> ;-)
> >>
> >> Performance. This is one of the reasons why Uncle Chutney says "Big
> >> things
> >> are made up of lots of little things." In a client-server app, this is
> >> especially true. Small increases or decreases in performance can make a
> >> big
> >> difference when a lot of clients are accessing a web app. Multiply the
> >> difference in performance by the number of clients, and you can see why.
> >>
> >> There are lots of little things you can do to dramatically increase
> >> performance. I'll try to hit the big ones.
> >>
> >> 1. In a client-server app, any work done by the client means a big
> >> savings
> >> on the server. The more clients the bigger the savings. Use client-side
> >> processing and JavaScript whenever possible.
> >> 2. If your App is written in VB.Net, make sure that Option Strict is
> >> turned
> >> ON! Late-binding is anathema to performance.
> >> 3. Avoid duplication in your app. Don't duplicate values, and don't
> >> duplicate code. Any time you see the same few lines of code in several
> >> places, you're looking at a good candidate for a function or Sub. If you
> >> have created a number of classes that have the same fields, properties,
> >> and/or methods, you're looking at a good candidate for a base class, and
> >> derived classes.
> >> 4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
> >> quite useful; others are one-size-fits-all memory hogs for beginners, to
> >> make it easy for them to make something happen without much trouble.
> >> 5. Close and/or Dispose any objects that use unmanaged resources as
> >> quickly
> >> as possible.
> >> 6. Close database connections ASAP.
> >>
> >> On a similar note, it should be stressed that performance is a factor in
> >> designing your app. The fastest apps have much more lower-level code in
> >> them, and are also more proprietary overall. Writing an app that is
> >> easily
> >> extensible may involve a trade-off of performance over code
> >> maintainability.
> >> Striking the right balance is an art.
> >>
> >> I'm sure I've overlooked several things, but I do believe I've hit on the
> >> majors in this list. At any rate, I hope it helps.
> >>
> >> --
> >> HTH,
> >> Kevin Spencer
> >> ..Net Developer
> >> Microsoft MVP
> >> I get paid good money to
> >> solve puzzles for a living
> >>
> >> "Mike" <Mike@.discussions.microsoft.com> wrote in message
> >> news:1DA19F5F-C332-4818-959F-7881D0D3A61A@.microsoft.com...
> >> > Lets just say my app is done HOO HOO.
> >> >> > Now, I'm accessing the database via a web service and one thing i
> >> > noticed
> >> > that my app is running real slow. When I first started working on the
> >> > app
> >> is
> >> > ran pretty quick returned the data to the screens in about 2 - 3
> >> > seconds.
> >> Now
> >> > its going about 5 - 10 seconds. How can I beef it up for better
> >> performance.
> >> >> >>
> >>
> >>
>
Hi Mike,
> The only question i have it the Option Strict. I turned that ON and when I
> recompiled the project. I got all kinds of errors such as
Awesome! Sounds like you're coming from a VB background. Option Strict
ensures that you use correct data types in your code. The difference between
late and early binding is that Late Binding means that your app explicitly
declares data types, and doesn't mix and match them. This way, the app
already knows at run-time how much memory to allocate for each object. When
late-binding is used, the data type of an object may NOT be known at
run-time, and the Platform has to figure out how much memory to allocate by
calculation, which often involves the use of Reflection. It can slow your
app down quite a bit.
The errors can be fixed by going through your code, and making sure that you
explicitly declare the correct data type for each field, property, or
variable that you are using. Also, avoid the use of the "Object" data type.
Object is the base class for ALL data types, and is therefore a
"late-binding class." So, for example, here is a field and Property declared
with no Data Types:
Private _DayOfWeek = 1
Public Property DayofWeek
Get
Return _DayOfWeek
End Get
Set (ByVal Value)
_DayOfWeek = Value
End Set
End Property
Using this (Option Strinct OFF), you could assign a TexBox value (always a
string) to DayOfWeek, and it would compile fine. At run-time, the String
would have to be converted to a number by the Platform.
Instead, you would put (Option Strict ON):
Private _DayOfWeek As Short = 1
Public Property DayofWeek As Short
Get
Return _DayOfWeek
End Get
Set (ByVal Value As Short)
_DayOfWeek = Value
End Set
End Property
Your code will compile fine, as long as nothing in your code tries to assign
a String to DayOfWeek. You will get a "Data Type Mismatch" error if you do.
As I'm sure you can see, this also prevents a lot of errors (assigning a
non-numeric string to be used as a Short, for example), as well as informing
the Platform to allocate 16 Bits for _DayOfWeek.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:8AEAF9A6-319B-4298-AC79-2991C3F89A2A@.microsoft.com...
> All good points. Actually all the db connections are closed and all the db
> transactions are being done in the web service. The html(aspx) pages call
the
> function needed and then i do formatting on the aspx pages, such as the
> datagrids.
> The only question i have it the Option Strict. I turned that ON and when I
> recompiled the project. I got all kinds of errors such as
> Option Strict On Disallows implicit conversions from 'String' to 'Short'
> how do i fix that?
> "Kevin Spencer" wrote:
> > > Lets just say my app is done HOO HOO.
> > I hate it when my app is done HOO HOO. But what are you going to do?
Live it
> > or live with it, as the young lady says...
> > ;-)
> > Performance. This is one of the reasons why Uncle Chutney says "Big
things
> > are made up of lots of little things." In a client-server app, this is
> > especially true. Small increases or decreases in performance can make a
big
> > difference when a lot of clients are accessing a web app. Multiply the
> > difference in performance by the number of clients, and you can see why.
> > There are lots of little things you can do to dramatically increase
> > performance. I'll try to hit the big ones.
> > 1. In a client-server app, any work done by the client means a big
savings
> > on the server. The more clients the bigger the savings. Use client-side
> > processing and JavaScript whenever possible.
> > 2. If your App is written in VB.Net, make sure that Option Strict is
turned
> > ON! Late-binding is anathema to performance.
> > 3. Avoid duplication in your app. Don't duplicate values, and don't
> > duplicate code. Any time you see the same few lines of code in several
> > places, you're looking at a good candidate for a function or Sub. If you
> > have created a number of classes that have the same fields, properties,
> > and/or methods, you're looking at a good candidate for a base class, and
> > derived classes.
> > 4. Avoid using the "drag and drop" tools in the toolbox. Some of them
are
> > quite useful; others are one-size-fits-all memory hogs for beginners, to
> > make it easy for them to make something happen without much trouble.
> > 5. Close and/or Dispose any objects that use unmanaged resources as
quickly
> > as possible.
> > 6. Close database connections ASAP.
> > On a similar note, it should be stressed that performance is a factor in
> > designing your app. The fastest apps have much more lower-level code in
> > them, and are also more proprietary overall. Writing an app that is
easily
> > extensible may involve a trade-off of performance over code
maintainability.
> > Striking the right balance is an art.
> > I'm sure I've overlooked several things, but I do believe I've hit on
the
> > majors in this list. At any rate, I hope it helps.
> > --
> > HTH,
> > Kevin Spencer
> > ..Net Developer
> > Microsoft MVP
> > I get paid good money to
> > solve puzzles for a living
> > "Mike" <Mike@.discussions.microsoft.com> wrote in message
> > news:1DA19F5F-C332-4818-959F-7881D0D3A61A@.microsoft.com...
> > > Lets just say my app is done HOO HOO.
> > > > Now, I'm accessing the database via a web service and one thing i
noticed
> > > that my app is running real slow. When I first started working on the
app
> > is
> > > ran pretty quick returned the data to the screens in about 2 - 3
seconds.
> > Now
> > > its going about 5 - 10 seconds. How can I beef it up for better
> > performance.
> >
Please post some code.
Greg
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:24DE9539-DB6D-446D-A5BA-E7B6E4A19960@.microsoft.com...
> That worked on the one error.
> Now i'm getting Option Strict On disallows Late binding.
> I'm doing some formatting of the datagrids based on certain data that is
> returned.
> How can i fix that issue now?
> I need to format the grids based on the data being returned
> "Greg Burns" wrote:
>> Dim x as string = "99"
>> Dim y as short = CType(x, Short)
>> OR
>> Dim y as short = CShort(x)
>>
>> You'll use a lot of CType with Option Strict On, but it is worth the
>> extra
>> effort.
>>
>> Greg
>>
>> "Mike" <Mike@.discussions.microsoft.com> wrote in message
>> news:8AEAF9A6-319B-4298-AC79-2991C3F89A2A@.microsoft.com...
>> > All good points. Actually all the db connections are closed and all the
>> > db
>> > transactions are being done in the web service. The html(aspx) pages
>> > call
>> > the
>> > function needed and then i do formatting on the aspx pages, such as the
>> > datagrids.
>> > The only question i have it the Option Strict. I turned that ON and
>> > when I
>> > recompiled the project. I got all kinds of errors such as
>>> > Option Strict On Disallows implicit conversions from 'String' to
>> > 'Short'
>>> > how do i fix that?
>>> > "Kevin Spencer" wrote:
>>> >> > Lets just say my app is done HOO HOO.
>> >>
>> >> I hate it when my app is done HOO HOO. But what are you going to do?
>> >> Live
>> >> it
>> >> or live with it, as the young lady says...
>> >>
>> >> ;-)
>> >>
>> >> Performance. This is one of the reasons why Uncle Chutney says "Big
>> >> things
>> >> are made up of lots of little things." In a client-server app, this is
>> >> especially true. Small increases or decreases in performance can make
>> >> a
>> >> big
>> >> difference when a lot of clients are accessing a web app. Multiply the
>> >> difference in performance by the number of clients, and you can see
>> >> why.
>> >>
>> >> There are lots of little things you can do to dramatically increase
>> >> performance. I'll try to hit the big ones.
>> >>
>> >> 1. In a client-server app, any work done by the client means a big
>> >> savings
>> >> on the server. The more clients the bigger the savings. Use
>> >> client-side
>> >> processing and JavaScript whenever possible.
>> >> 2. If your App is written in VB.Net, make sure that Option Strict is
>> >> turned
>> >> ON! Late-binding is anathema to performance.
>> >> 3. Avoid duplication in your app. Don't duplicate values, and don't
>> >> duplicate code. Any time you see the same few lines of code in several
>> >> places, you're looking at a good candidate for a function or Sub. If
>> >> you
>> >> have created a number of classes that have the same fields,
>> >> properties,
>> >> and/or methods, you're looking at a good candidate for a base class,
>> >> and
>> >> derived classes.
>> >> 4. Avoid using the "drag and drop" tools in the toolbox. Some of them
>> >> are
>> >> quite useful; others are one-size-fits-all memory hogs for beginners,
>> >> to
>> >> make it easy for them to make something happen without much trouble.
>> >> 5. Close and/or Dispose any objects that use unmanaged resources as
>> >> quickly
>> >> as possible.
>> >> 6. Close database connections ASAP.
>> >>
>> >> On a similar note, it should be stressed that performance is a factor
>> >> in
>> >> designing your app. The fastest apps have much more lower-level code
>> >> in
>> >> them, and are also more proprietary overall. Writing an app that is
>> >> easily
>> >> extensible may involve a trade-off of performance over code
>> >> maintainability.
>> >> Striking the right balance is an art.
>> >>
>> >> I'm sure I've overlooked several things, but I do believe I've hit on
>> >> the
>> >> majors in this list. At any rate, I hope it helps.
>> >>
>> >> --
>> >> HTH,
>> >> Kevin Spencer
>> >> ..Net Developer
>> >> Microsoft MVP
>> >> I get paid good money to
>> >> solve puzzles for a living
>> >>
>> >> "Mike" <Mike@.discussions.microsoft.com> wrote in message
>> >> news:1DA19F5F-C332-4818-959F-7881D0D3A61A@.microsoft.com...
>> >> > Lets just say my app is done HOO HOO.
>> >>> >> > Now, I'm accessing the database via a web service and one thing i
>> >> > noticed
>> >> > that my app is running real slow. When I first started working on
>> >> > the
>> >> > app
>> >> is
>> >> > ran pretty quick returned the data to the screens in about 2 - 3
>> >> > seconds.
>> >> Now
>> >> > its going about 5 - 10 seconds. How can I beef it up for better
>> >> performance.
>> >>> >>> >>
>> >>
>> >>
>>
>>
>
performance question
Now, I'm accessing the database via a web service and one thing i noticed
that my app is running real slow. When I first started working on the app is
ran pretty quick returned the data to the screens in about 2 - 3 seconds. No
w
its going about 5 - 10 seconds. How can I beef it up for better performance.> Lets just say my app is done HOO HOO.
I hate it when my app is done HOO HOO. But what are you going to do? Live it
or live with it, as the young lady says...
;-)
Performance. This is one of the reasons why Uncle Chutney says "Big things
are made up of lots of little things." In a client-server app, this is
especially true. Small increases or decreases in performance can make a big
difference when a lot of clients are accessing a web app. Multiply the
difference in performance by the number of clients, and you can see why.
There are lots of little things you can do to dramatically increase
performance. I'll try to hit the big ones.
1. In a client-server app, any work done by the client means a big savings
on the server. The more clients the bigger the savings. Use client-side
processing and JavaScript whenever possible.
2. If your App is written in VB.Net, make sure that Option Strict is turned
ON! Late-binding is anathema to performance.
3. Avoid duplication in your app. Don't duplicate values, and don't
duplicate code. Any time you see the same few lines of code in several
places, you're looking at a good candidate for a function or Sub. If you
have created a number of classes that have the same fields, properties,
and/or methods, you're looking at a good candidate for a base class, and
derived classes.
4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
quite useful; others are one-size-fits-all memory hogs for beginners, to
make it easy for them to make something happen without much trouble.
5. Close and/or Dispose any objects that use unmanaged resources as quickly
as possible.
6. Close database connections ASAP.
On a similar note, it should be stressed that performance is a factor in
designing your app. The fastest apps have much more lower-level code in
them, and are also more proprietary overall. Writing an app that is easily
extensible may involve a trade-off of performance over code maintainability.
Striking the right balance is an art.
I'm sure I've overlooked several things, but I do believe I've hit on the
majors in this list. At any rate, I hope it helps.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:1DA19F5F-C332-4818-959F-7881D0D3A61A@.microsoft.com...
> Lets just say my app is done HOO HOO.
> Now, I'm accessing the database via a web service and one thing i noticed
> that my app is running real slow. When I first started working on the app
is
> ran pretty quick returned the data to the screens in about 2 - 3 seconds.
Now
> its going about 5 - 10 seconds. How can I beef it up for better
performance.
>
All good points. Actually all the db connections are closed and all the db
transactions are being done in the web service. The html(aspx) pages call th
e
function needed and then i do formatting on the aspx pages, such as the
datagrids.
The only question i have it the Option Strict. I turned that ON and when I
recompiled the project. I got all kinds of errors such as
Option Strict On Disallows implicit conversions from 'String' to 'Short'
how do i fix that?
"Kevin Spencer" wrote:
> I hate it when my app is done HOO HOO. But what are you going to do? Live
it
> or live with it, as the young lady says...
> ;-)
> Performance. This is one of the reasons why Uncle Chutney says "Big things
> are made up of lots of little things." In a client-server app, this is
> especially true. Small increases or decreases in performance can make a bi
g
> difference when a lot of clients are accessing a web app. Multiply the
> difference in performance by the number of clients, and you can see why.
> There are lots of little things you can do to dramatically increase
> performance. I'll try to hit the big ones.
> 1. In a client-server app, any work done by the client means a big savings
> on the server. The more clients the bigger the savings. Use client-side
> processing and JavaScript whenever possible.
> 2. If your App is written in VB.Net, make sure that Option Strict is turne
d
> ON! Late-binding is anathema to performance.
> 3. Avoid duplication in your app. Don't duplicate values, and don't
> duplicate code. Any time you see the same few lines of code in several
> places, you're looking at a good candidate for a function or Sub. If you
> have created a number of classes that have the same fields, properties,
> and/or methods, you're looking at a good candidate for a base class, and
> derived classes.
> 4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
> quite useful; others are one-size-fits-all memory hogs for beginners, to
> make it easy for them to make something happen without much trouble.
> 5. Close and/or Dispose any objects that use unmanaged resources as quickl
y
> as possible.
> 6. Close database connections ASAP.
> On a similar note, it should be stressed that performance is a factor in
> designing your app. The fastest apps have much more lower-level code in
> them, and are also more proprietary overall. Writing an app that is easily
> extensible may involve a trade-off of performance over code maintainabilit
y.
> Striking the right balance is an art.
> I'm sure I've overlooked several things, but I do believe I've hit on the
> majors in this list. At any rate, I hope it helps.
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
> "Mike" <Mike@.discussions.microsoft.com> wrote in message
> news:1DA19F5F-C332-4818-959F-7881D0D3A61A@.microsoft.com...
> is
> Now
> performance.
>
>
Dim x as string = "99"
Dim y as short = CType(x, Short)
OR
Dim y as short = CShort(x)
You'll use a lot of CType with Option Strict On, but it is worth the extra
effort.
Greg
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:8AEAF9A6-319B-4298-AC79-2991C3F89A2A@.microsoft.com...
> All good points. Actually all the db connections are closed and all the db
> transactions are being done in the web service. The html(aspx) pages call
> the
> function needed and then i do formatting on the aspx pages, such as the
> datagrids.
> The only question i have it the Option Strict. I turned that ON and when I
> recompiled the project. I got all kinds of errors such as
> Option Strict On Disallows implicit conversions from 'String' to 'Short'
> how do i fix that?
> "Kevin Spencer" wrote:
>
That worked on the one error.
Now i'm getting Option Strict On disallows Late binding.
I'm doing some formatting of the datagrids based on certain data that is
returned.
How can i fix that issue now?
I need to format the grids based on the data being returned
"Greg Burns" wrote:
> Dim x as string = "99"
> Dim y as short = CType(x, Short)
> OR
> Dim y as short = CShort(x)
> You'll use a lot of CType with Option Strict On, but it is worth the extra
> effort.
> Greg
> "Mike" <Mike@.discussions.microsoft.com> wrote in message
> news:8AEAF9A6-319B-4298-AC79-2991C3F89A2A@.microsoft.com...
>
>
Hi Mike,
> The only question i have it the Option Strict. I turned that ON and when I
> recompiled the project. I got all kinds of errors such as
Awesome! Sounds like you're coming from a VB background. Option Strict
ensures that you use correct data types in your code. The difference between
late and early binding is that Late Binding means that your app explicitly
declares data types, and doesn't mix and match them. This way, the app
already knows at run-time how much memory to allocate for each object. When
late-binding is used, the data type of an object may NOT be known at
run-time, and the Platform has to figure out how much memory to allocate by
calculation, which often involves the use of Reflection. It can slow your
app down quite a bit.
The errors can be fixed by going through your code, and making sure that you
explicitly declare the correct data type for each field, property, or
variable that you are using. Also, avoid the use of the "Object" data type.
Object is the base class for ALL data types, and is therefore a
"late-binding class." So, for example, here is a field and Property declared
with no Data Types:
Private _DayOfW
Public Property DayofW
Get
Return _DayOfW
End Get
Set (ByVal Value)
_DayOfW
End Set
End Property
Using this (Option Strinct OFF), you could assign a TexBox value (always a
string) to DayOfW
would have to be converted to a number by the Platform.
Instead, you would put (Option Strict ON):
Private _DayOfW
Public Property DayofW
Get
Return _DayOfW
End Get
Set (ByVal Value As Short)
_DayOfW
End Set
End Property
Your code will compile fine, as long as nothing in your code tries to assign
a String to DayOfW
As I'm sure you can see, this also prevents a lot of errors (assigning a
non-numeric string to be used as a Short, for example), as well as informing
the Platform to allocate 16 Bits for _DayOfW
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:8AEAF9A6-319B-4298-AC79-2991C3F89A2A@.microsoft.com...
> All good points. Actually all the db connections are closed and all the db
> transactions are being done in the web service. The html(aspx) pages call
the
> function needed and then i do formatting on the aspx pages, such as the
> datagrids.
> The only question i have it the Option Strict. I turned that ON and when I
> recompiled the project. I got all kinds of errors such as
> Option Strict On Disallows implicit conversions from 'String' to 'Short'
> how do i fix that?
> "Kevin Spencer" wrote:
>
Live it
things
big
savings
turned
are
quickly
easily
maintainability.
the
noticed
app
seconds.
Please post some code.
Greg
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:24DE9539-DB6D-446D-A5BA-E7B6E4A19960@.microsoft.com...
> That worked on the one error.
> Now i'm getting Option Strict On disallows Late binding.
> I'm doing some formatting of the datagrids based on certain data that is
> returned.
> How can i fix that issue now?
> I need to format the grids based on the data being returned
> "Greg Burns" wrote:
>
Performance questions
I have 2 different sites with the same aspnet code.
Both are running in their own app pool.
1st one is the important site and performance for this one is more important
than the second one.
Of course in the codes I have some customization routines.
One of those routine shows and assigns url for a hyperlink.
For the important (high traffic) site (site 1) I need to show that link and
for the 2nd site I need to hide that link.
Now the question is:
Should I make this hyperlink visible from the HTML part which will be
suitable for site 1 and hide it from codebehind in the second site?
Is there any performance difference doing the vise versa?
The following is the code I have now:
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
}
else
{
hyperlink.Visible = false;
}
However the following code looks nicer but will it give any performance hit
to site 1?
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
hyperlink.Visible = true;
}
Looking forward for your advise.
--
SevDer
http://www.sevder.com
A new source for .NET DevelopersI don't think this is kind of code would be the performance bottleneck.
Typically it is either related to database access, or complicated
calculations or processing in the code. Setting one property on a hyperlink
isn't going to make a difference.
"SevDer" <sevder@.newsgroup.nospamwrote in message
news:etavoPztGHA.4752@.TK2MSFTNGP03.phx.gbl...
Quote:
Originally Posted by
Hi
>
I have 2 different sites with the same aspnet code.
Both are running in their own app pool.
>
1st one is the important site and performance for this one is more
important than the second one.
Of course in the codes I have some customization routines.
>
One of those routine shows and assigns url for a hyperlink.
For the important (high traffic) site (site 1) I need to show that link
and for the 2nd site I need to hide that link.
>
Now the question is:
Should I make this hyperlink visible from the HTML part which will be
suitable for site 1 and hide it from codebehind in the second site?
Is there any performance difference doing the vise versa?
>
The following is the code I have now:
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
}
else
{
hyperlink.Visible = false;
}
>
However the following code looks nicer but will it give any performance
hit to site 1?
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
hyperlink.Visible = true;
}
>
Looking forward for your advise.
--
>
SevDer
http://www.sevder.com
A new source for .NET Developers
>
>
>
I don't think that either of these options will have much of an effect on performance... how often is this code called?
--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Hi,
I don't really have a problem with the performance and the difference
between them is may be 1/10000000 but I just want to know which one is
faster.
May be in the future this information may help me on 100 show or hide items
in one page where there are tremendous amount of hits to that page.
--
SevDer
http://www.sevder.com
A new source for .NET Developers
"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_comwrote in message
news:%23Ydm2TztGHA.4456@.TK2MSFTNGP06.phx.gbl...
I don't think that either of these options will have much of an effect on
performance... how often is this code called?
--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Well, if you have to set 2 properties instead of 1, then setting 2 will take
longer.
But even with 100 of these controls, you aren't going to see a difference.
This is just changing a variable in an object. That variable is used when
it's time to generate the corresponding HTML. But by setting the property,
you are just changing some local variable to the object.
Again, unless you have tens of thousands of these, this isn't going to make
a difference. I would focus on more likely bottlenecks in terms of
performance.
"SevDer" <sevder@.newsgroup.nospamwrote in message
news:%23jry6iztGHA.4752@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi,
>
I don't really have a problem with the performance and the difference
between them is may be 1/10000000 but I just want to know which one is
faster.
May be in the future this information may help me on 100 show or hide
items in one page where there are tremendous amount of hits to that page.
>
--
>
SevDer
http://www.sevder.com
A new source for .NET Developers
>
>
"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_comwrote in message
news:%23Ydm2TztGHA.4456@.TK2MSFTNGP06.phx.gbl...
I don't think that either of these options will have much of an effect on
performance... how often is this code called?
>
--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
>
>
>
Monday, March 26, 2012
Performance tuning ASP.NET applications
Some users are experiencing major performance issues during the save process. I'm looking for any pointers to articles on the web which can help me analyze/determine where the bottlenecks are in the entire process, i.e. is it a client problem, IIS problem or SQL Server problem.
Any help on how to do this would be greatly appreciated!
Thanks!!
Here's a few online resources related to ASP.NET performance:
ASP.NET Performance Overview
Improving ASP.NET Performance
ASP.NET Performance
Getting Started - Enhancing Web Site Performance with Caching
Optimizing Performance in ASP.NET
Developing High-Performance ASP.NET Applications
Hope these links help.
-- Erik Reitan
ASP.NET User Education
This posting is provided "AS IS" with no warranties, and confers no rights.
Om Sri Sai Ram
Performance :
http://msdn.microsoft.com/practices/compcat/default.aspx?pull=/library/en-us/dnpag/html/scalenet.asp
Caching:
http://msdn.microsoft.com/practices/compcat/default.aspx?pull=/library/en-us/dnbda/html/cachingarch.asp
Thanks,
Ram
Saturday, March 24, 2012
Permission Denied Writing to a file
Help.
buzzWow! I hope this server is not exposed to the Internet in any way.
First, you should use NTFS and not FAT32 (there are no permissions on FAT32 disks).
And making ASPNET an administrator is something you should never do. You could edit the machine.config file instead and make the process use SYSTEM instead of ASPNET. I don't even recommend doing this, and you should really just give enough rights on the directories to ASPNET so that you can write to your file.
Does this help?
I'm just in development on my desktop for now, which is why it's FAT32, and the only reason why I made the ASPNET account an admin was to troubleshoot my permission denied error. That's why I mentioned it, because even with it being an admin I'm still getting this error.
You should use NTFS on your dev machines too. I doubt that you will be able to sort this one out except if you use NTFS. I haven't checked this, but I wouldn't be surprised if we used low permissions by default if the file system is Fat, as there are no permissions on this file system.
And 'low permissions' means no write permission, ever, anywhere? That would be remarkably restrictive, wouldn't it? Aren't there some IIS settings I can look at? I also went into my app in IIS and gave write permission in there and that didn't work either.
Thanks for your input.
buzz
Once again, I'm not sure about that at all.
But usually, a web site has no need to write files.
And it would be incredibly dangerous to allow writing to an unprotected file system by default.
I strongly recommend you use NTFS in all circumstances. Fat32 is only there for Win9x compatibility.
I see, well I'll look into converting to NTFS.
>> But usually, a web site has no need to write files.
Is this true? I'm not an expert, but what about uploading files, etc? Also, I want to write to a file for logging purposes, for when my database goes down.
Thanks for all your help!
buzz
Yes, that's why I said "usually".
Most sites don't need to upload files. And if you upload, you should do so in a directory that's not acessible from the web, for obvious security reasons, whenever possible. And you should always require reliable authentication when you allow for it.
Logging can be done using the System.Diagnostics namespace, using the standard Windows event logs.
Permission for bin folder: ASP.NET app deployed under a web site
I have an asp.net application and I have deployed it under a Web Site. I am
using IIS 6.0.
However, while running the application it fails saying that can't monitor
file changes under bin directory and access is denied.
I have given read permission to ASPNET and Impersonation account. However,
it still fails.
If I give permission to "everyone" to read the bin folder it works fine.
How do I find out which account the application is trying to use to read the
bin directory or which account needs the read permission?
Any pointer or help.
Thanks in advance
SachinHi,
Try NETWORK SERVICE account
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Sachin" <annonymous@.microsoft.com> wrote in message
news:OaczMSczFHA.3188@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I have an asp.net application and I have deployed it under a Web Site. I
> am
> using IIS 6.0.
> However, while running the application it fails saying that can't monitor
> file changes under bin directory and access is denied.
> I have given read permission to ASPNET and Impersonation account. However,
> it still fails.
> If I give permission to "everyone" to read the bin folder it works fine.
> How do I find out which account the application is trying to use to read
> the
> bin directory or which account needs the read permission?
> Any pointer or help.
> Thanks in advance
> Sachin
>
To add to Teemu's advice
WIN 2003 uses servername\Network service acct
Patrick
"Teemu Keiski" <joteke@.aspalliance.com> wrote in message
news:ezNsr5czFHA.2212@.TK2MSFTNGP15.phx.gbl...
> Hi,
> Try NETWORK SERVICE account
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
> "Sachin" <annonymous@.microsoft.com> wrote in message
> news:OaczMSczFHA.3188@.TK2MSFTNGP14.phx.gbl...
monitor
However,
>
Patrick.O.Ige wrote:
> To add to Teemu's advice
> WIN 2003 uses servername\Network service acct
> Patrick
>
However, it's important to note that IIS 6 is hard-coded to check
permissions for the IIS_WPG group of which NETWORK SERVICE is a member.
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com
FrontPage add-ins for FrontPage 2000 - 2003
Permission for bin folder: ASP.NET app deployed under a web site
I have an asp.net application and I have deployed it under a Web Site. I am
using IIS 6.0.
However, while running the application it fails saying that can't monitor
file changes under bin directory and access is denied.
I have given read permission to ASPNET and Impersonation account. However,
it still fails.
If I give permission to "everyone" to read the bin folder it works fine.
How do I find out which account the application is trying to use to read the
bin directory or which account needs the read permission?
Any pointer or help.
Thanks in advance
SachinHi,
Try NETWORK SERVICE account
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Sachin" <annonymous@.microsoft.com> wrote in message
news:OaczMSczFHA.3188@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I have an asp.net application and I have deployed it under a Web Site. I
> am
> using IIS 6.0.
> However, while running the application it fails saying that can't monitor
> file changes under bin directory and access is denied.
> I have given read permission to ASPNET and Impersonation account. However,
> it still fails.
> If I give permission to "everyone" to read the bin folder it works fine.
> How do I find out which account the application is trying to use to read
> the
> bin directory or which account needs the read permission?
> Any pointer or help.
> Thanks in advance
> Sachin
To add to Teemu's advice
WIN 2003 uses servername\Network service acct
Patrick
"Teemu Keiski" <joteke@.aspalliance.com> wrote in message
news:ezNsr5czFHA.2212@.TK2MSFTNGP15.phx.gbl...
> Hi,
> Try NETWORK SERVICE account
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
> "Sachin" <annonymous@.microsoft.com> wrote in message
> news:OaczMSczFHA.3188@.TK2MSFTNGP14.phx.gbl...
> > Hi All,
> > I have an asp.net application and I have deployed it under a Web Site. I
> > am
> > using IIS 6.0.
> > However, while running the application it fails saying that can't
monitor
> > file changes under bin directory and access is denied.
> > I have given read permission to ASPNET and Impersonation account.
However,
> > it still fails.
> > If I give permission to "everyone" to read the bin folder it works fine.
> > How do I find out which account the application is trying to use to read
> > the
> > bin directory or which account needs the read permission?
> > Any pointer or help.
> > Thanks in advance
> > Sachin
Patrick.O.Ige wrote:
> To add to Teemu's advice
> WIN 2003 uses servername\Network service acct
> Patrick
However, it's important to note that IIS 6 is hard-coded to check
permissions for the IIS_WPG group of which NETWORK SERVICE is a member.
--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com
FrontPage add-ins for FrontPage 2000 - 2003
Wednesday, March 21, 2012
Permissions issue running .aspx files...
Server cannot access application directory "C:\Inetpub\www". The directory does not exist or is not accessible because of security settings.
Now of course the directory exists, and the permissions were (and remain) set properly for my other .asp files to run, just not the .aspx files I create with WebMatrix. All my googling indicates I have to set the permissions for an ASPNET user, which apparently 2003 doesn't use; NETWORK SERVICES runs stuff, but as that's not a user per se, I don't know how to "give it rights" so I'm at a loss.
I gave full rights (just to test, I set these back after) for the IUSER, IWAM, and IIS_WPG users, and no soup. I also have a user OWS_xxxxxxx_admin which is described as "MIcrosoft SharePoint role 'admin' for web..." but that also didn't do it. Here's why I definitely think it's a rights issue: I gave "Everybody" full rights and then my page loads. Here's the kicker though; I took away "Everybody" and gave just "Doman Users" full rights, and it doesn't work. So the impression I get is that it's trying to use a username to run scripts that doesn't exist in my domain... as if the user was somehow 'lost'.
I've also heard mention of a machine.cfg file which has the username in it to use for running scripts, but I do not appear to have such a file. Is that normal on 2k3?
Any help would be appreciated. My next resort is going to be to backup my www, and uninstall and reinstall IIS, which I would like to avoid, as my plethora of other web projects are all working. Thanks!!Update: I was wrong about the machine.cfg file, because I had the wrong extension, I see now that it's machine.config. However, I followed a knowledge base article which said to create a weak user, give it log on as a batch rights, and then add it to the machine.config file and reboot. Still no soup.
Um, bump? Anybody have any ideas? I'm still stuck on this, and haven't found anything else in my research.
Thanks in advance!
JazzGilbert wrote:
C:\Inetpub\www". The directory does not exist or is not accessible because of security settings
Who is listed on the security tab for WWW?
FYI I am also on 2003 server with AD
Have you configured the directory as an application and have you configured the web service extenstions for asp.net xxxxx
Is aspx listed in Virtual or Home Directory Tab: Configuration...:Mappings Tab:Application extensions for your application subdirectoy?
Ok, on the WWW folder under Security, I've got the following:
ASPUser with Full Rights (I created this user per the KB article)
IIS_WPG with Read & Execute
the Internet Guest Account (IUSR_machinename) with Read & Execute
the Launch IIS Process Account (IWAM_machinename) with Read & Execute
I've tried, one at a time, giving them full control, that didn't make a difference.
Maybe that's the issue, (configuring the directory as an app) because all I did was create a folder in my WWW and made sure it had the same rights as the WWW folder.
As far as extensions, I am able to run notepad created .asp files. It's the .aspx file I created in WebMatrix that fails. I think I have the right services setup, but here's a screenshot.
http://www.abeyantdestiny.com/services.gif
I think you need to create an app on the directory tab of the folder.
Also check to see which application pool is selected. It should be "ASP.NET"
Then check the identity being used by that pool.
Also to test that is has nothing to do with webmatrix... take a extreamly simple html page that you know already works on your web page and simply change the extenstion from .html to .aspx
If it works then it is webmatrix that is causing the problem if it doesn't then it is a server config issuse.
Also I can perhaps send some screen shots of my config if you need. If desired then send an private email using this site and include your email address.
Permissions Problem
Can you please let me know which database you are using (though I'm guessing you mean Access)? I will then move your message to the relevant database forum.
Yeah, sorry not to include that, Im using access.
I don't think this has anything to do with the database per se. A403 error means the web server is denying access to the page it isbeing requested to serve. I'd check folder permissions.
There are no permissions on my folder, the security tab isnt eventhere. I think its because I am the only user on my computer, soeverything should have full permissions.
The reason that you do not have the Security tab is that you are using Windows XP Home. In this operating system, Simple File Sharing is always enabled, which means that you will never see the Security tab (at least, according to MSDN).Skerb wrote:
There are no permissions on my folder, the security tab isnt even there. I think its because I am the only user on my computer, so everything should have full permissions.
May I ask that you copy (not move) your .mdb database file into the same folder as your .aspx page. In your .aspx page (or web.config), update the connection string to point to this new version of your Access database. Thismay be a simple solution to your permissions problem.
The web pages, database, and web.config are already in the same folder
Permissions Problem?
System.IO.DirectoryNotFoundException: Could not find a part of the path "E:\".
Here is the code that is causing the problem. Any suggestions?
'lets create the directory incase it doesnt exist
If Directory.Exists(ConfigurationSettings.AppSettings("rootDir") & "extrapics\" & subDir1 & "\") = False Then
Directory.CreateDirectory(ConfigurationSettings.AppSettings("rootDir") & "extrapics\" & subDir1 & "\")
End If
Any tips are greatly appreciated..
Thanks,
MikeIs this running on your machine? Is E a hard drive, or is it a network drive?
Brian
Hi Brian, - thanks for the response.
The E: is in fact on my machine, yes. Other applications are successfully running on it as well
Thanks again
mike123
Did you try writing out the full path to see where it was going? Maybe there is an error in the path:
Response.Write(ConfigurationSettings.AppSettings("rootDir") & "extrapics\" & subDir1 & "\")
Also, is this web application going to always run on your machine? If not, shared paths \\machine instead of e:\ are preferred.
Brian
Hi Brian,
This web application is always going to run on machine yes. I initially thought it was an error in the path as well due to the error return message however I have double checked and the path is perfectly fine.
Any ideas?
Thanks again
mike123
Does the ASPNET account have the permissions, or if your app declares impersonation, does that account have permissions?
Brian
Hi Brian,
The ASPNET account only has read access. My app does not declare impersonation I believe because I did not set it up. It would be in the web.config if configured for this, correct?
Internet Guest Account and Network Services have all permissions except full control.
Is this setup wrong? My Application pool is running under network services
Thanks very much for your help,
Mike123
anyone got any thoughts on this ? .. im COMPLETELY stuck :(
Are you running windows 2003?
Have you tried granting read access to the "network service" account?
Regards
Fredr!k
Hi Fredrik2000,
Yes I am running windows 2003, and yes the network service has read access. I thought this might be the problem too, but does not seem to be.
Thanks for the help, any other suggestions are warmly welcomed :)
Mike123
is there any other account I can give permissions to test on?
Is e: your system drive?
Is there a policy for folder traversal (is that the name), what I mean is if your user has
correct rights to a subdirectory and not to one of the folders it is located in...
Regards
Fredr!k
Hi Fredrik2000,
Yes, the E: is a system drive.
As far as folder traversal (if thats what its called ;)), I set the permissions at the root level to help debug this with still no luck.
I just gave "Everyone" full control, and its still not working. I've debugged the values passed to the createdirectory procedure, and the path is correct.
I'm totally stuck on where to go with this . Any ideas?
Thanks again,
Mike123
Permissions to Sql2005 database from IIS
I am setting up a Sql2005 database on a Windows Server, running Windows
Server 2003. The database is going to be accessed via users using an
ASP.Net website.
My website is running the normal IUSR account. And users must login to
the website, which uses Forms Authentication.
I do not want to give users access directly to tables, so have created
many stored procedures which will carry out the operations that i would
like users to be able to do.
I do not want to use Sql Authentication.
How should i setup permissions on my database?
At the moment i have set up the NETWORK SERVICE account (account for
running asp.net) on my server to be a role member of the db_owner group
for the database. This allows the user access to all the object in my
database, as everything is owned by dbo.
Is this correct? This doesnt sound right to me? Do i have to setup
another user in my Sql database?IM new to SQL 2005 as well, but Im working through the implementation and
Maintainence book and it expplicitly tells you not to user the Network
Service account because it has too many privilages. It reccomends setting up
a new account to manage each instance.
"Nemisis" <darrens2005@.hotmail.com> wrote in message
news:1166537606.961583.187640@.a3g2000cwd.googlegroups.com...
> Hi everyone, hope your all looking forward to xmas.
> I am setting up a Sql2005 database on a Windows Server, running Windows
> Server 2003. The database is going to be accessed via users using an
> ASP.Net website.
> My website is running the normal IUSR account. And users must login to
> the website, which uses Forms Authentication.
> I do not want to give users access directly to tables, so have created
> many stored procedures which will carry out the operations that i would
> like users to be able to do.
> I do not want to use Sql Authentication.
> How should i setup permissions on my database?
> At the moment i have set up the NETWORK SERVICE account (account for
> running asp.net) on my server to be a role member of the db_owner group
> for the database. This allows the user access to all the object in my
> database, as everything is owned by dbo.
> Is this correct? This doesnt sound right to me? Do i have to setup
> another user in my Sql database?
>
Hi nemesis.
Is you database server & Web Server located on the same machine?
If yes
You could create a local (technical) user account & have the application
run under an application pool with the technical user account.
On the DB level , just create the login & user account and grant execute
on the stored procedure.
If No
instead of a local (technical) user account have a domain account made.
the rest of the setup is just the same.
As a side note , never have any application account part of db_owner ,
this means the app. could just drop all tables in your DB .
Yvesl
Nemisis wrote:
Nemisis wrote:
> Hi everyone, hope your all looking forward to xmas.
> I am setting up a Sql2005 database on a Windows Server, running Windows
> Server 2003. The database is going to be accessed via users using an
> ASP.Net website.
> My website is running the normal IUSR account. And users must login to
> the website, which uses Forms Authentication.
> I do not want to give users access directly to tables, so have created
> many stored procedures which will carry out the operations that i would
> like users to be able to do.
> I do not want to use Sql Authentication.
> How should i setup permissions on my database?
> At the moment i have set up the NETWORK SERVICE account (account for
> running asp.net) on my server to be a role member of the db_owner group
> for the database. This allows the user access to all the object in my
> database, as everything is owned by dbo.
> Is this correct? This doesnt sound right to me? Do i have to setup
> another user in my Sql database?
> Hi everyone, hope your all looking forward to xmas.
> I am setting up a Sql2005 database on a Windows Server, running Windows
> Server 2003. The database is going to be accessed via users using an
> ASP.Net website.
> My website is running the normal IUSR account. And users must login to
> the website, which uses Forms Authentication.
> I do not want to give users access directly to tables, so have created
> many stored procedures which will carry out the operations that i would
> like users to be able to do.
> I do not want to use Sql Authentication.
> How should i setup permissions on my database?
> At the moment i have set up the NETWORK SERVICE account (account for
> running asp.net) on my server to be a role member of the db_owner group
> for the database. This allows the user access to all the object in my
> database, as everything is owned by dbo.
> Is this correct? This doesnt sound right to me? Do i have to setup
> another user in my Sql database?
>
Thanks alot for this, my database server and web server are on the same
machine.
I will try to setup a account and set the correct permission first
thing in the morning.
The new account that i will setup, does it need access to the tables?
Because before when i tried to execute a stored procedure, it said that
select permissions had to be set on the table as well. Is this still
the case'
Should the new account be apart of a role in the database? Or should i
created my own?
Thanks again for your help so far.
Hi,
Assuming you're only using stored procedure your new user (lets call him
LOCALSERVER\TEST) does not need any access to the tables.
It needs EXECUTE right to the stored procedures.
here's the script to grant access.
GRANT EXECUTE ON [dbo].[AddSp] TO [LOCALSERVER\TEST]
GRANT EXECUTE ON [dbo].[GetSp] TO [LOCALSERVER\TEST]
For Role Membership, well it all depends on what your requirements are.
For more informed help you should probably ask this newsgroup:
microsoft.public.sqlserver.server
however my 2c:
Since your Database will be accessed only through 1 user account( the
one that your web app. runs under) I don't think it's necessary to
create any Role.
YvesL
Nemisis wrote:
> Thanks alot for this, my database server and web server are on the same
> machine.
> I will try to setup a account and set the correct permission first
> thing in the morning.
> The new account that i will setup, does it need access to the tables?
> Because before when i tried to execute a stored procedure, it said that
> select permissions had to be set on the table as well. Is this still
> the case'
> Should the new account be apart of a role in the database? Or should i
> created my own?
> Thanks again for your help so far.
>
Yves. L. wrote:
> Hi,
> Assuming you're only using stored procedure your new user (lets call him
> LOCALSERVER\TEST) does not need any access to the tables.
> It needs EXECUTE right to the stored procedures.
> here's the script to grant access.
> GRANT EXECUTE ON [dbo].[AddSp] TO [LOCALSERVER\TEST]
> GRANT EXECUTE ON [dbo].[GetSp] TO [LOCALSERVER\TEST]
>
> For Role Membership, well it all depends on what your requirements are.
> For more informed help you should probably ask this newsgroup:
> microsoft.public.sqlserver.server
> however my 2=80c:
> Since your Database will be accessed only through 1 user account( the
> one that your web app. runs under) I don't think it's necessary to
> create any Role.
> YvesL
Yves,
What about if i need to run dynamic Sql? Will this still be ok? I
hear that there are some problems when running dynamic Sql?
>
> Yves,
> What about if i need to run dynamic Sql? Will this still be ok? I
> hear that there are some problems when running dynamic Sql?
>
I suppose that you mean SQL statements in code ?
Then you'll need to set the proper permission on the necessary tables,
views, etc,... or make your user part of the db_datawriter or
db_datareader roles (see the docs for reference).
Anyway, you wrote earlier that you have SP'for all data access, so you
should be fine .
Regards,
YvesL
Yes the users only execute stored procedures, but within some of the
stored procedures, i execute dynamic Sql, using the execute_sql system
stored procedure.
I was told that it was not a good idea to make a user apart of the
db_owner role, is making them a part of the db_datareader and
db_datawriter role ok?
I am using Sql2005, so does this still apply? I didnt know if i should
do something different for Sql2005?
Thanks
> Yes the users only execute stored procedures, but within some of the
> stored procedures, i execute dynamic Sql, using the execute_sql system
> stored procedure.
I don't know about that, you'll have to try it out or ask the sqlserver
newsgroup.
> I was told that it was not a good idea to make a user apart of the
> db_owner role, is making them a part of the db_datareader and
> db_datawriter role ok?
Have a look at
ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.SQLSVR.v9.en/udb9/html/7f3fa5f6-6b50-
43bb-9047-1544ade55e39.htm
it describes what access users get for those database roles
Regards,
YvesL
Permissions to Sql2005 database from IIS
I am setting up a Sql2005 database on a Windows Server, running Windows
Server 2003. The database is going to be accessed via users using an
ASP.Net website.
My website is running the normal IUSR account. And users must login to
the website, which uses Forms Authentication.
I do not want to give users access directly to tables, so have created
many stored procedures which will carry out the operations that i would
like users to be able to do.
I do not want to use Sql Authentication.
How should i setup permissions on my database?
At the moment i have set up the NETWORK SERVICE account (account for
running asp.net) on my server to be a role member of the db_owner group
for the database. This allows the user access to all the object in my
database, as everything is owned by dbo.
Is this correct? This doesnt sound right to me? Do i have to setup
another user in my Sql database?IM new to SQL 2005 as well, but Im working through the implementation and
Maintainence book and it expplicitly tells you not to user the Network
Service account because it has too many privilages. It reccomends setting up
a new account to manage each instance.
"Nemisis" <darrens2005@.hotmail.comwrote in message
news:1166537606.961583.187640@.a3g2000cwd.googlegro ups.com...
Quote:
Originally Posted by
Hi everyone, hope your all looking forward to xmas.
>
I am setting up a Sql2005 database on a Windows Server, running Windows
Server 2003. The database is going to be accessed via users using an
ASP.Net website.
>
My website is running the normal IUSR account. And users must login to
the website, which uses Forms Authentication.
>
I do not want to give users access directly to tables, so have created
many stored procedures which will carry out the operations that i would
like users to be able to do.
>
I do not want to use Sql Authentication.
>
How should i setup permissions on my database?
>
At the moment i have set up the NETWORK SERVICE account (account for
running asp.net) on my server to be a role member of the db_owner group
for the database. This allows the user access to all the object in my
database, as everything is owned by dbo.
>
Is this correct? This doesnt sound right to me? Do i have to setup
another user in my Sql database?
>
Hi nemesis.
Is you database server & Web Server located on the same machine?
If yes
You could create a local (technical) user account & have the application
run under an application pool with the technical user account.
On the DB level , just create the login & user account and grant execute
on the stored procedure.
If No
instead of a local (technical) user account have a domain account made.
the rest of the setup is just the same.
As a side note , never have any application account part of db_owner ,
this means the app. could just drop all tables in your DB .
Yvesl
Nemisis wrote:
Nemisis wrote:
Quote:
Originally Posted by
Hi everyone, hope your all looking forward to xmas.
>
I am setting up a Sql2005 database on a Windows Server, running Windows
Server 2003. The database is going to be accessed via users using an
ASP.Net website.
>
My website is running the normal IUSR account. And users must login to
the website, which uses Forms Authentication.
>
I do not want to give users access directly to tables, so have created
many stored procedures which will carry out the operations that i would
like users to be able to do.
>
I do not want to use Sql Authentication.
>
How should i setup permissions on my database?
>
At the moment i have set up the NETWORK SERVICE account (account for
running asp.net) on my server to be a role member of the db_owner group
for the database. This allows the user access to all the object in my
database, as everything is owned by dbo.
>
Is this correct? This doesnt sound right to me? Do i have to setup
another user in my Sql database?
>
Hi everyone, hope your all looking forward to xmas.
>
I am setting up a Sql2005 database on a Windows Server, running Windows
Server 2003. The database is going to be accessed via users using an
ASP.Net website.
>
My website is running the normal IUSR account. And users must login to
the website, which uses Forms Authentication.
>
I do not want to give users access directly to tables, so have created
many stored procedures which will carry out the operations that i would
like users to be able to do.
>
I do not want to use Sql Authentication.
>
How should i setup permissions on my database?
>
At the moment i have set up the NETWORK SERVICE account (account for
running asp.net) on my server to be a role member of the db_owner group
for the database. This allows the user access to all the object in my
database, as everything is owned by dbo.
>
Is this correct? This doesnt sound right to me? Do i have to setup
another user in my Sql database?
>
Thanks alot for this, my database server and web server are on the same
machine.
I will try to setup a account and set the correct permission first
thing in the morning.
The new account that i will setup, does it need access to the tables?
Because before when i tried to execute a stored procedure, it said that
select permissions had to be set on the table as well. Is this still
the case??
Should the new account be apart of a role in the database? Or should i
created my own?
Thanks again for your help so far.
Hi,
Assuming you're only using stored procedure your new user (lets call him
LOCALSERVER\TEST) does not need any access to the tables.
It needs EXECUTE right to the stored procedures.
here's the script to grant access.
GRANT EXECUTE ON [dbo].[AddSp] TO [LOCALSERVER\TEST]
GRANT EXECUTE ON [dbo].[GetSp] TO [LOCALSERVER\TEST]
For Role Membership, well it all depends on what your requirements are.
For more informed help you should probably ask this newsgroup:
microsoft.public.sqlserver.server
however my 2c:
Since your Database will be accessed only through 1 user account( the
one that your web app. runs under) I don't think it's necessary to
create any Role.
YvesL
Nemisis wrote:
Quote:
Originally Posted by
Thanks alot for this, my database server and web server are on the same
machine.
>
I will try to setup a account and set the correct permission first
thing in the morning.
>
The new account that i will setup, does it need access to the tables?
Because before when i tried to execute a stored procedure, it said that
select permissions had to be set on the table as well. Is this still
the case??
>
Should the new account be apart of a role in the database? Or should i
created my own?
>
Thanks again for your help so far.
>
Yves. L. wrote:
Quote:
Originally Posted by
Hi,
Assuming you're only using stored procedure your new user (lets call him
LOCALSERVER\TEST) does not need any access to the tables.
It needs EXECUTE right to the stored procedures.
>
here's the script to grant access.
GRANT EXECUTE ON [dbo].[AddSp] TO [LOCALSERVER\TEST]
GRANT EXECUTE ON [dbo].[GetSp] TO [LOCALSERVER\TEST]
>
>
>
For Role Membership, well it all depends on what your requirements are.
For more informed help you should probably ask this newsgroup:
microsoft.public.sqlserver.server
>
however my 2c:
Since your Database will be accessed only through 1 user account( the
one that your web app. runs under) I don't think it's necessary to
create any Role.
>
YvesL
Yves,
What about if i need to run dynamic Sql? Will this still be ok? I
hear that there are some problems when running dynamic Sql?
>
Quote:
Originally Posted by
Yves,
>
What about if i need to run dynamic Sql? Will this still be ok? I
hear that there are some problems when running dynamic Sql?
>
I suppose that you mean SQL statements in code ?
Then you'll need to set the proper permission on the necessary tables,
views, etc,... or make your user part of the db_datawriter or
db_datareader roles (see the docs for reference).
Anyway, you wrote earlier that you have SP'for all data access, so you
should be fine .
--
Regards,
YvesL
Yes the users only execute stored procedures, but within some of the
stored procedures, i execute dynamic Sql, using the execute_sql system
stored procedure.
I was told that it was not a good idea to make a user apart of the
db_owner role, is making them a part of the db_datareader and
db_datawriter role ok?
I am using Sql2005, so does this still apply? I didnt know if i should
do something different for Sql2005?
Thanks
Yes the users only execute stored procedures, but within some of the
Quote:
Originally Posted by
stored procedures, i execute dynamic Sql, using the execute_sql system
stored procedure.
I don't know about that, you'll have to try it out or ask the sqlserver
newsgroup.
Quote:
Originally Posted by
>
I was told that it was not a good idea to make a user apart of the
db_owner role, is making them a part of the db_datareader and
db_datawriter role ok?
Have a look at
ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.SQLSVR.v9.en/udb9/html/7f3fa5f6-6b50-43bb-9047-1544ade55e39.htm
it describes what access users get for those database roles
--
Regards,
YvesL
Hope u all had a merry xmas, and happy new year too you all.
I have followed the steps in the article
http://www.sommarskog.se/grantperm.html.
1. Create a certificate
2. Create a user associated with that certificate
3. Grant that user SELECT rights on the table
4. Sign the procedure with the certificate EACH TIME you have changed
the procedure
Encase you dont know, i have had to create this certificate as i am
executing dynamic Sql within some of my stored procedures, and i dont
want to give the user any permissions to the tables.
I am a lil confused, as i have to create a user (above) to associate
with the certificate, and i have to give that user permissions to the
table directly. Would it not have been easier just to give the main
user (web application IIS user, NETWORK SERVICE) direct permissions to
the tables, instead of setting another user up?
Could someone please clarify why this is the case and the benefits of
it, i have to also inform other people why we are going to set the
application up like this.
Thanks