Thursday, March 29, 2012
Performance of an ASP.Net application
version, are there any other deployment and/or .Net CLR settings that
can be used to improve the application performance?Not really. You can tweak how IIS and ASP.NET work via the machine.config's
processModel, but I doubt you'll get much out of it.
IF you are seeing performance issues, caching using OutputCaching and the
Cache api as well as database tuning are generally good quick hits.
Karl
http://www.openmymind.net/
http://www.codebetter.com/
<robin9876@.hotmail.com> wrote in message
news:1162894730.222245.309590@.m73g2000cwd.googlegroups.com...
> After reviewing the code and compiling the application as release
> version, are there any other deployment and/or .Net CLR settings that
> can be used to improve the application performance?
>
Here is a Wonderful document which help you in improving the performance of
the application
http://www.microsoft.com/downloads/...&displaylang=en
Regards
Prabakar
"robin9876@.hotmail.com" wrote:
> After reviewing the code and compiling the application as release
> version, are there any other deployment and/or .Net CLR settings that
> can be used to improve the application performance?
>
Performance of an ASP.Net application
version, are there any other deployment and/or .Net CLR settings that
can be used to improve the application performance?Not really. You can tweak how IIS and ASP.NET work via the machine.config's
processModel, but I doubt you'll get much out of it.
IF you are seeing performance issues, caching using OutputCaching and the
Cache api as well as database tuning are generally good quick hits.
Karl
--
http://www.openmymind.net/
http://www.codebetter.com/
<robin9876@.hotmail.comwrote in message
news:1162894730.222245.309590@.m73g2000cwd.googlegr oups.com...
Quote:
Originally Posted by
After reviewing the code and compiling the application as release
version, are there any other deployment and/or .Net CLR settings that
can be used to improve the application performance?
>
Here is a Wonderful document which help you in improving the performance of
the application
http://www.microsoft.com/downloads/...&displaylang=en
Regards
Prabakar
"robin9876@.hotmail.com" wrote:
Quote:
Originally Posted by
After reviewing the code and compiling the application as release
version, are there any other deployment and/or .Net CLR settings that
can be used to improve the application performance?
>
>
performance of code
Is there someway to profile your code in Visual Studio with reagard to performance, meaning, to see the time elapse per code that is crunching behind the scenes? I have an application that seems to slow way down at a certain page but I really have no idea where it is hanging up?
Thanks in advance,
Eric
I havent found anything that tests for complexity, calculating the McCabe factor etc.. like there is in C++ and fortran or Delphi.
However here is a link that does have a freeware program you can download to test performance
http://www.alessandropulvirenti.it/programmazione/ for c# and VB
You can enable Tracing on your page (just add Trace="true" to the page directive of your aspx page), and then use Trace.Write(DateTime.Now); to determine what time different sections of code are executed.
Hi Eric,
Based on my understanding, you want to know how to analyze your application performance. If I have misunderstood you, please feel free to let me know.
To better understand your question, could you please confirm the following information:
What version of Visual Studio are you using? If you use Visual Studio 2005 Team Edition, you can use Performance tools which be integrated with development environment (IDE) to measure, evaluate, and target performance-related issues in your code. For more information, see Analyzing Application Performance.
I hope this helps.
Tracing is very clumsy and awkward to set up and leaves you with swathes of code to remove once you've sorted the problems out.
Consider using something like this:
http://www.red-gate.com/products/ants_profiler/
you can get some pretty good results fromhttp://www.jetbrains.com/profiler/
They offer a 10 day trial.
Performance Q..
the search text. Is it required to use the text box here, I can use html
input text box and can pass this value for search at the server side when
user clicks the search button.
IS it a good design approach to avoid server side text boxes when compared
to HTML input boxes?
NelsonIt's all a matter of functionality. If all you need is an HTML input form
object, and you don't need it to retain its value across PostBacks,
certainly, a Server Control is not necessary.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
>
Hi Nelson,
I guess you should use the TextBox control. Because, as I know, the normal
requirement for a Search window is to persist the search query after the
page post backs and gets the results. So, if you use html INPUT, you would
have to use another hidden variable to achieve this, with asp.net TextBox
control you would have the ViewState, which does this automatically if you
keep it enabled. If you do not bother about preserviing the search criteria,
go with html INPUT control with runat server
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
>
After the search results (using ZIP Code) I am displaying city, state etc
corresponds to the zip code using a text box control. Is there anyway I can
avoid text box here?
Thanks for your reply.
Nelson
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
> It's all a matter of functionality. If all you need is an HTML input form
> object, and you don't need it to retain its value across PostBacks,
> certainly, a Server Control is not necessary.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> get
when
compared
>
1. By making Run at server can I access the search text from the server side
code. Is it correct?
2. In terms of performance does it matter between HTML INPUT control with
runat server attribute and ASP Server side text box.
Thanks for your suggestions.
Nelson.
"Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> Hi Nelson,
> I guess you should use the TextBox control. Because, as I know, the
normal
> requirement for a Search window is to persist the search query after the
> page post backs and gets the results. So, if you use html INPUT, you would
> have to use another hidden variable to achieve this, with asp.net TextBox
> control you would have the ViewState, which does this automatically if you
> keep it enabled. If you do not bother about preserviing the search
criteria,
> go with html INPUT control with runat server
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> get
when
compared
>
I never did performance tests. But, if you set "EnableViewState" to false,
asp.net TextBox is very much same as html INPUT with runat server. Yes by
making runat = server, you could access the text in the server side. Since
this is the only textbox control on your page, you shouldnt be too worried
about performance I guess
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:O2UURsOyEHA.2196@.TK2MSFTNGP14.phx.gbl...
> 1. By making Run at server can I access the search text from the server
side
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> normal
would
TextBox
you
> criteria,
to
html
> when
> compared
>
The only performance hit I see is when the asp.net engine converts this
server control into the HTML output for a normal html textbox. Otherwise,
user the textbox control. Nobody will know the difference. The page has to
be compiled either way so its only going to take this hit the first time
"Nelson" wrote:
> 1. By making Run at server can I access the search text from the server si
de
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> normal
> criteria,
> when
> compared
>
>
Hi Nelson,
It all depends on what you want the user to do with the data. If you simply
want to display it, a form input object is not necessary; you can simply
write it out to the page. If, on the other hand, you want the user to be
able to edit it, change, it, etc., you would need a form field. And again,
if you want the values in a form field to survive PostBacks, you need to use
a Server Control. Adding "runat=server" to a Control, and declaring it in
the CodeBehind class, effectively creates a Server Control (an HTMLInputText
Control). You can then manipulate and work with the Control in the
CodeBehind class on the server, and it will retain its value across
PostBacks.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:uhgKBmOyEHA.924@.TK2MSFTNGP10.phx.gbl...
> After the search results (using ZIP Code) I am displaying city, state etc
> corresponds to the zip code using a text box control. Is there anyway I
can
> avoid text box here?
> Thanks for your reply.
> Nelson
>
> "Kevin Spencer" <kspencer@.takempis.com> wrote in message
> news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
form
to
html
> when
> compared
>
Performance Q..
the search text. Is it required to use the text box here, I can use html
input text box and can pass this value for search at the server side when
user clicks the search button.
IS it a good design approach to avoid server side text boxes when compared
to HTML input boxes?
NelsonIt's all a matter of functionality. If all you need is an HTML input form
object, and you don't need it to retain its value across PostBacks,
certainly, a Server Control is not necessary.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
Hi Nelson,
I guess you should use the TextBox control. Because, as I know, the normal
requirement for a Search window is to persist the search query after the
page post backs and gets the results. So, if you use html INPUT, you would
have to use another hidden variable to achieve this, with asp.net TextBox
control you would have the ViewState, which does this automatically if you
keep it enabled. If you do not bother about preserviing the search criteria,
go with html INPUT control with runat server
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
After the search results (using ZIP Code) I am displaying city, state etc
corresponds to the zip code using a text box control. Is there anyway I can
avoid text box here?
Thanks for your reply.
Nelson
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
> It's all a matter of functionality. If all you need is an HTML input form
> object, and you don't need it to retain its value across PostBacks,
> certainly, a Server Control is not necessary.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > In one of the search window (zip code search) I am using ASP Text box to
> get
> > the search text. Is it required to use the text box here, I can use html
> > input text box and can pass this value for search at the server side
when
> > user clicks the search button.
> > IS it a good design approach to avoid server side text boxes when
compared
> > to HTML input boxes?
> > Nelson
1. By making Run at server can I access the search text from the server side
code. Is it correct?
2. In terms of performance does it matter between HTML INPUT control with
runat server attribute and ASP Server side text box.
Thanks for your suggestions.
Nelson.
"Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> Hi Nelson,
> I guess you should use the TextBox control. Because, as I know, the
normal
> requirement for a Search window is to persist the search query after the
> page post backs and gets the results. So, if you use html INPUT, you would
> have to use another hidden variable to achieve this, with asp.net TextBox
> control you would have the ViewState, which does this automatically if you
> keep it enabled. If you do not bother about preserviing the search
criteria,
> go with html INPUT control with runat server
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > In one of the search window (zip code search) I am using ASP Text box to
> get
> > the search text. Is it required to use the text box here, I can use html
> > input text box and can pass this value for search at the server side
when
> > user clicks the search button.
> > IS it a good design approach to avoid server side text boxes when
compared
> > to HTML input boxes?
> > Nelson
I never did performance tests. But, if you set "EnableViewState" to false,
asp.net TextBox is very much same as html INPUT with runat server. Yes by
making runat = server, you could access the text in the server side. Since
this is the only textbox control on your page, you shouldnt be too worried
about performance I guess
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:O2UURsOyEHA.2196@.TK2MSFTNGP14.phx.gbl...
> 1. By making Run at server can I access the search text from the server
side
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> > Hi Nelson,
> > I guess you should use the TextBox control. Because, as I know, the
> normal
> > requirement for a Search window is to persist the search query after the
> > page post backs and gets the results. So, if you use html INPUT, you
would
> > have to use another hidden variable to achieve this, with asp.net
TextBox
> > control you would have the ViewState, which does this automatically if
you
> > keep it enabled. If you do not bother about preserviing the search
> criteria,
> > go with html INPUT control with runat server
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box
to
> > get
> > > the search text. Is it required to use the text box here, I can use
html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> >
The only performance hit I see is when the asp.net engine converts this
server control into the HTML output for a normal html textbox. Otherwise,
user the textbox control. Nobody will know the difference. The page has to
be compiled either way so its only going to take this hit the first time
"Nelson" wrote:
> 1. By making Run at server can I access the search text from the server side
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> > Hi Nelson,
> > I guess you should use the TextBox control. Because, as I know, the
> normal
> > requirement for a Search window is to persist the search query after the
> > page post backs and gets the results. So, if you use html INPUT, you would
> > have to use another hidden variable to achieve this, with asp.net TextBox
> > control you would have the ViewState, which does this automatically if you
> > keep it enabled. If you do not bother about preserviing the search
> criteria,
> > go with html INPUT control with runat server
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box to
> > get
> > > the search text. Is it required to use the text box here, I can use html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> > >
Hi Nelson,
It all depends on what you want the user to do with the data. If you simply
want to display it, a form input object is not necessary; you can simply
write it out to the page. If, on the other hand, you want the user to be
able to edit it, change, it, etc., you would need a form field. And again,
if you want the values in a form field to survive PostBacks, you need to use
a Server Control. Adding "runat=server" to a Control, and declaring it in
the CodeBehind class, effectively creates a Server Control (an HTMLInputText
Control). You can then manipulate and work with the Control in the
CodeBehind class on the server, and it will retain its value across
PostBacks.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:uhgKBmOyEHA.924@.TK2MSFTNGP10.phx.gbl...
> After the search results (using ZIP Code) I am displaying city, state etc
> corresponds to the zip code using a text box control. Is there anyway I
can
> avoid text box here?
> Thanks for your reply.
> Nelson
>
> "Kevin Spencer" <kspencer@.takempis.com> wrote in message
> news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
> > It's all a matter of functionality. If all you need is an HTML input
form
> > object, and you don't need it to retain its value across PostBacks,
> > certainly, a Server Control is not necessary.
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Neither a follower
> > nor a lender be.
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box
to
> > get
> > > the search text. Is it required to use the text box here, I can use
html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> >
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 tweak
I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:
this.OnFillParameters(selectCommand);
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
try
{
selectAdapter.Fill(resultsDataSet);
....
Does anyone have any suggestions/pointers on how this could be improved.
Any comments welcomed.
Thanks,
JYhi,
sorry what do you mean by bottle neck?
Jon wrote:
> Hello all,
> I've been doing some performance analysis on our app, and I've discovered
> that the below code is quite a bottle neck:
> this.OnFillParameters(selectCommand);
> SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
> try
> {
> selectAdapter.Fill(resultsDataSet);
> ....
>
> Does anyone have any suggestions/pointers on how this could be improved.
> Any comments welcomed.
> Thanks,
> JY
Hi,
My apologies, I shouldn't use local terms on international forums! :)
By bottle next I mean an area of the application that is the slowest.
Thanks,
Jon
"Varangian" wrote:
> hi,
> sorry what do you mean by bottle neck?
>
> Jon wrote:
>
Hi Jon,
BottleNeck is a common technical term, so don't sweat it!
You've got some pretty simple code there. How many records does it fetch?
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:23D239C3-8A52-45ED-B123-951CB9881745@.microsoft.com...
> Hi,
> My apologies, I shouldn't use local terms on international forums! :)
> By bottle next I mean an area of the application that is the slowest.
> Thanks,
> Jon
> "Varangian" wrote:
>
Unless you're calling that code inside a loop, I can't see that it's
going to cause performance problems. You can always use a SqlDataReader
directly if you want the fastest access to your data but, in all
likelyhood, the performance problem lies with your database query.
Jon wrote:
> Hi,
> My apologies, I shouldn't use local terms on international forums! :)
> By bottle next I mean an area of the application that is the slowest.
> Thanks,
> Jon
> "Varangian" wrote:
>
Hi Kevin and thanks for the reply.
The SP returns varying amounts of data, but even for say 100 records, it's
slow. I do know that the Database and SP's need to be looked at, for example
,
if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values fro
m
the first SP (you get the idea!).
But I'd prefer to start with the C# code, as it's less of a beast, and more
my domain. The DB has other issues, I'm really just trying to quel the fire
so to speak.
I was thinking of using the MS DAB, not the June 2005 release. Would that be
better? I'm really just looking for some advice / help.
Thanks again,
Jon
"Kevin Spencer" wrote:
> Hi Jon,
> BottleNeck is a common technical term, so don't sweat it!
> You've got some pretty simple code there. How many records does it fetch?
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Software Composer
> http://unclechutney.blogspot.com
> If the Truth hurts, wear it.
> "Jon" <Jon@.discussions.microsoft.com> wrote in message
> news:23D239C3-8A52-45ED-B123-951CB9881745@.microsoft.com...
>
>
The first thing you should do, if you can, is look at the execution of
your procedure in Sql Query Analyzer and see how much of the time spent
in that block is accounted for by SQL server. Without knowing the
numbers, you can't optimise usefully.
There's not much code there to optimise. It isn't teh uber-leet h4x0r
fastest way of doing DB access, but the difference between that and
other methods is going to be minimal.
If that code is running slowly, I would place hard-earned money on the
issue being time spent inside Sql server. I don't honestly think you
will make any measurable dent on your performance problem by tweaking
that code.
Of course, if I'm wrong, I want to know about it, so let people know
what you find out in any case.
-- Bob Gregory
Unvalued Professional.
Jon wrote:
> Hi Kevin and thanks for the reply.
> The SP returns varying amounts of data, but even for say 100 records, it's
> slow. I do know that the Database and SP's need to be looked at, for examp
le,
> if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values f
rom
> the first SP (you get the idea!).
> But I'd prefer to start with the C# code, as it's less of a beast, and mor
e
> my domain. The DB has other issues, I'm really just trying to quel the fir
e
> so to speak.
> I was thinking of using the MS DAB, not the June 2005 release. Would that
be
> better? I'm really just looking for some advice / help.
> Thanks again,
> Jon
> "Kevin Spencer" wrote:
>
Hi Jon,
You're correct about optimizing the stored procedures, which I can't really
say anything about. As for your code, yes, it could be optimized, depending
upon your requirements. For example, it sounds like you're simply fetching a
single set of data, or a single DataTable. But you're using a DataSet, which
is a rather large and complex class that mimics a database in many ways,
holding numerous DataTables, handling relationships, etc. One optimization
would be to simply use a DataTable with a SqlDataReader. The SqlDataReader
is a very fast little class (which is actually used by a SqlDataAdapter to
do the work that it does in filling DataTables and DataSets). You can fetch
the data with the SqlDataReader, and then pass it as a parameter to the
DataTable.Load method. See
http://msdn2.microsoft.com/en-us/li...table.load.aspx for
more details, and good luck!
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:0520A1D8-956E-44B1-8ACD-55DC3F6EC783@.microsoft.com...
> Hi Kevin and thanks for the reply.
> The SP returns varying amounts of data, but even for say 100 records, it's
> slow. I do know that the Database and SP's need to be looked at, for
> example,
> if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values
> from
> the first SP (you get the idea!).
> But I'd prefer to start with the C# code, as it's less of a beast, and
> more
> my domain. The DB has other issues, I'm really just trying to quel the
> fire
> so to speak.
> I was thinking of using the MS DAB, not the June 2005 release. Would that
> be
> better? I'm really just looking for some advice / help.
> Thanks again,
> Jon
> "Kevin Spencer" wrote:
>
Performance tweak
I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:
this.OnFillParameters(selectCommand);
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
try
{
selectAdapter.Fill(resultsDataSet);
.....
Does anyone have any suggestions/pointers on how this could be improved.
Any comments welcomed.
Thanks,
JYhi,
sorry what do you mean by bottle neck?
Jon wrote:
Quote:
Originally Posted by
Hello all,
I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:
this.OnFillParameters(selectCommand);
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
try
{
selectAdapter.Fill(resultsDataSet);
....
>
Does anyone have any suggestions/pointers on how this could be improved.
Any comments welcomed.
Thanks,
JY
Hi,
My apologies, I shouldn't use local terms on international forums! :)
By bottle next I mean an area of the application that is the slowest.
Thanks,
Jon
"Varangian" wrote:
Quote:
Originally Posted by
hi,
>
sorry what do you mean by bottle neck?
>
>
Jon wrote:
Quote:
Originally Posted by
Hello all,
I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:
this.OnFillParameters(selectCommand);
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
try
{
selectAdapter.Fill(resultsDataSet);
....
Does anyone have any suggestions/pointers on how this could be improved.
Any comments welcomed.
Thanks,
JY
>
>
Hi Jon,
BottleNeck is a common technical term, so don't sweat it!
You've got some pretty simple code there. How many records does it fetch?
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Jon" <Jon@dotnet.itags.org.discussions.microsoft.comwrote in message
news:23D239C3-8A52-45ED-B123-951CB9881745@dotnet.itags.org.microsoft.com...
Quote:
Originally Posted by
Hi,
>
My apologies, I shouldn't use local terms on international forums! :)
>
By bottle next I mean an area of the application that is the slowest.
>
Thanks,
>
Jon
>
"Varangian" wrote:
>
Quote:
Originally Posted by
>hi,
>>
>sorry what do you mean by bottle neck?
>>
>>
>Jon wrote:
Quote:
Originally Posted by
Hello all,
>
I've been doing some performance analysis on our app, and I've
discovered
that the below code is quite a bottle neck:
>
this.OnFillParameters(selectCommand);
>
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
>
try
{
selectAdapter.Fill(resultsDataSet);
....
>
>
Does anyone have any suggestions/pointers on how this could be
improved.
>
Any comments welcomed.
>
Thanks,
>
JY
>>
>>
Unless you're calling that code inside a loop, I can't see that it's
going to cause performance problems. You can always use a SqlDataReader
directly if you want the fastest access to your data but, in all
likelyhood, the performance problem lies with your database query.
Jon wrote:
Quote:
Originally Posted by
Hi,
>
My apologies, I shouldn't use local terms on international forums! :)
>
By bottle next I mean an area of the application that is the slowest.
>
Thanks,
>
Jon
>
"Varangian" wrote:
>
Quote:
Originally Posted by
hi,
sorry what do you mean by bottle neck?
Jon wrote:
Quote:
Originally Posted by
Hello all,
>
I've been doing some performance analysis on our app, and I've discovered
that the below code is quite a bottle neck:
>
this.OnFillParameters(selectCommand);
>
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
>
try
{
selectAdapter.Fill(resultsDataSet);
....
>
>
Does anyone have any suggestions/pointers on how this could be improved.
>
Any comments welcomed.
>
Thanks,
>
JY
Hi Kevin and thanks for the reply.
The SP returns varying amounts of data, but even for say 100 records, it's
slow. I do know that the Database and SP's need to be looked at, for example,
if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values from
the first SP (you get the idea!).
But I'd prefer to start with the C# code, as it's less of a beast, and more
my domain. The DB has other issues, I'm really just trying to quel the fire
so to speak.
I was thinking of using the MS DAB, not the June 2005 release. Would that be
better? I'm really just looking for some advice / help.
Thanks again,
Jon
"Kevin Spencer" wrote:
Quote:
Originally Posted by
Hi Jon,
>
BottleNeck is a common technical term, so don't sweat it!
>
You've got some pretty simple code there. How many records does it fetch?
>
--
HTH,
>
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
>
If the Truth hurts, wear it.
>
"Jon" <Jon@dotnet.itags.org.discussions.microsoft.comwrote in message
news:23D239C3-8A52-45ED-B123-951CB9881745@dotnet.itags.org.microsoft.com...
Quote:
Originally Posted by
Hi,
My apologies, I shouldn't use local terms on international forums! :)
By bottle next I mean an area of the application that is the slowest.
Thanks,
Jon
"Varangian" wrote:
Quote:
Originally Posted by
hi,
>
sorry what do you mean by bottle neck?
>
>
Jon wrote:
Hello all,
I've been doing some performance analysis on our app, and I've
discovered
that the below code is quite a bottle neck:
this.OnFillParameters(selectCommand);
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
try
{
selectAdapter.Fill(resultsDataSet);
....
Does anyone have any suggestions/pointers on how this could be
improved.
Any comments welcomed.
Thanks,
JY
>
>
>
>
>
The first thing you should do, if you can, is look at the execution of
your procedure in Sql Query Analyzer and see how much of the time spent
in that block is accounted for by SQL server. Without knowing the
numbers, you can't optimise usefully.
There's not much code there to optimise. It isn't teh uber-leet h4x0r
fastest way of doing DB access, but the difference between that and
other methods is going to be minimal.
If that code is running slowly, I would place hard-earned money on the
issue being time spent inside Sql server. I don't honestly think you
will make any measurable dent on your performance problem by tweaking
that code.
Of course, if I'm wrong, I want to know about it, so let people know
what you find out in any case.
-- Bob Gregory
Unvalued Professional.
Jon wrote:
Quote:
Originally Posted by
Hi Kevin and thanks for the reply.
>
The SP returns varying amounts of data, but even for say 100 records, it's
slow. I do know that the Database and SP's need to be looked at, for example,
if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values from
the first SP (you get the idea!).
>
But I'd prefer to start with the C# code, as it's less of a beast, and more
my domain. The DB has other issues, I'm really just trying to quel the fire
so to speak.
>
I was thinking of using the MS DAB, not the June 2005 release. Would that be
better? I'm really just looking for some advice / help.
>
Thanks again,
>
Jon
>
"Kevin Spencer" wrote:
>
Quote:
Originally Posted by
Hi Jon,
BottleNeck is a common technical term, so don't sweat it!
You've got some pretty simple code there. How many records does it fetch?
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Jon" <Jon@dotnet.itags.org.discussions.microsoft.comwrote in message
news:23D239C3-8A52-45ED-B123-951CB9881745@dotnet.itags.org.microsoft.com...
Quote:
Originally Posted by
Hi,
>
My apologies, I shouldn't use local terms on international forums! :)
>
By bottle next I mean an area of the application that is the slowest.
>
Thanks,
>
Jon
>
"Varangian" wrote:
>
>hi,
>>
>sorry what do you mean by bottle neck?
>>
>>
>Jon wrote:
Hello all,
>
I've been doing some performance analysis on our app, and I've
discovered
that the below code is quite a bottle neck:
>
this.OnFillParameters(selectCommand);
>
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
>
try
{
selectAdapter.Fill(resultsDataSet);
....
>
>
Does anyone have any suggestions/pointers on how this could be
improved.
>
Any comments welcomed.
>
Thanks,
>
JY
>>
>>
Hi Jon,
You're correct about optimizing the stored procedures, which I can't really
say anything about. As for your code, yes, it could be optimized, depending
upon your requirements. For example, it sounds like you're simply fetching a
single set of data, or a single DataTable. But you're using a DataSet, which
is a rather large and complex class that mimics a database in many ways,
holding numerous DataTables, handling relationships, etc. One optimization
would be to simply use a DataTable with a SqlDataReader. The SqlDataReader
is a very fast little class (which is actually used by a SqlDataAdapter to
do the work that it does in filling DataTables and DataSets). You can fetch
the data with the SqlDataReader, and then pass it as a parameter to the
DataTable.Load method. See
http://msdn2.microsoft.com/en-us/li...table.load.aspx for
more details, and good luck!
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Jon" <Jon@dotnet.itags.org.discussions.microsoft.comwrote in message
news:0520A1D8-956E-44B1-8ACD-55DC3F6EC783@dotnet.itags.org.microsoft.com...
Quote:
Originally Posted by
Hi Kevin and thanks for the reply.
>
The SP returns varying amounts of data, but even for say 100 records, it's
slow. I do know that the Database and SP's need to be looked at, for
example,
if 1 SP returns 10 rows, it then fires off 10 SP's passing in the values
from
the first SP (you get the idea!).
>
But I'd prefer to start with the C# code, as it's less of a beast, and
more
my domain. The DB has other issues, I'm really just trying to quel the
fire
so to speak.
>
I was thinking of using the MS DAB, not the June 2005 release. Would that
be
better? I'm really just looking for some advice / help.
>
Thanks again,
>
Jon
>
"Kevin Spencer" wrote:
>
Quote:
Originally Posted by
>Hi Jon,
>>
>BottleNeck is a common technical term, so don't sweat it!
>>
>You've got some pretty simple code there. How many records does it fetch?
>>
>--
>HTH,
>>
>Kevin Spencer
>Microsoft MVP
>Software Composer
>http://unclechutney.blogspot.com
>>
>If the Truth hurts, wear it.
>>
>"Jon" <Jon@dotnet.itags.org.discussions.microsoft.comwrote in message
>news:23D239C3-8A52-45ED-B123-951CB9881745@dotnet.itags.org.microsoft.com...
Quote:
Originally Posted by
Hi,
>
My apologies, I shouldn't use local terms on international forums! :)
>
By bottle next I mean an area of the application that is the slowest.
>
Thanks,
>
Jon
>
"Varangian" wrote:
>
>hi,
>>
>sorry what do you mean by bottle neck?
>>
>>
>Jon wrote:
Hello all,
>
I've been doing some performance analysis on our app, and I've
discovered
that the below code is quite a bottle neck:
>
this.OnFillParameters(selectCommand);
>
SqlDataAdapter selectAdapter = new SqlDataAdapter(selectCommand);
>
try
{
selectAdapter.Fill(resultsDataSet);
....
>
>
Does anyone have any suggestions/pointers on how this could be
improved.
>
Any comments welcomed.
>
Thanks,
>
JY
>>
>>
>>
>>
>>
Performing issues
What is faster to IIS, a Code Behind file or a In Code aspx file?
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we call
inside the class when we call it?
Thanks
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to a
native image. Of course, caching mechanisms make most of that moot, as the
resources are no continually being re-compiled.
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Bruno Alexandre" <bruno.in.dk@.gmail.com> wrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
> Hi guys,
> What is faster to IIS, a Code Behind file or a In Code aspx file?
> When we call for a Class like dim f as new MyClass if it's a big class,
> will it take longer to run? or the IIS only access the funcions that we
> call inside the class when we call it?
> Thanks
> --
> Bruno Alexandre
> Kbenhavn, Danmark
> "a portuguese in Denmark"
>
>
Hi Kevin,
but I'm not talking about DLL, only VB files (classes) and having the code
in the same page or separete one.
I dont thing that the IIS will take my hole site and put it in diferent
DLL's (there is an option in framework 2.0 that we can do that into one DLL)
but this is not my point.
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"
"Kevin Spencer" <uce@.ftc.gov> escreveu na mensagem
news:uhr08DH6GHA.3508@.TK2MSFTNGP06.phx.gbl...
> An ASPX file is parsed at run-time to MSIL, which is then compiled to a
> native image. A DLL is MSIL, so it takes fewer operations to compile it to
> a native image. Of course, caching mechanisms make most of that moot, as
> the resources are no continually being re-compiled.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Software Composer
> http://unclechutney.blogspot.com
> If the Truth hurts, wear it.
> "Bruno Alexandre" <bruno.in.dk@.gmail.com> wrote in message
> news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
>
Performing issues
What is faster to IIS, a Code Behind file or a In Code aspx file?
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we call
inside the class when we call it?
Thanks
--
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to a
native image. Of course, caching mechanisms make most of that moot, as the
resources are no continually being re-compiled.
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Bruno Alexandre" <bruno.in.dk@.gmail.comwrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
Hi guys,
>
What is faster to IIS, a Code Behind file or a In Code aspx file?
>
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we
call inside the class when we call it?
>
Thanks
>
--
>
Bruno Alexandre
Kbenhavn, Danmark
>
"a portuguese in Denmark"
>
>
>
>
Hi Kevin,
but I'm not talking about DLL, only VB files (classes) and having the code
in the same page or separete one.
I dont thing that the IIS will take my hole site and put it in diferent
DLL's (there is an option in framework 2.0 that we can do that into one DLL)
but this is not my point.
--
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"
"Kevin Spencer" <uce@.ftc.govescreveu na mensagem
news:uhr08DH6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to
a native image. Of course, caching mechanisms make most of that moot, as
the resources are no continually being re-compiled.
>
--
HTH,
>
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
>
If the Truth hurts, wear it.
>
"Bruno Alexandre" <bruno.in.dk@.gmail.comwrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
>Hi guys,
>>
>What is faster to IIS, a Code Behind file or a In Code aspx file?
>>
>When we call for a Class like dim f as new MyClass if it's a big class,
>will it take longer to run? or the IIS only access the funcions that we
>call inside the class when we call it?
>>
>Thanks
>>
>--
>>
>Bruno Alexandre
>Kbenhavn, Danmark
>>
>"a portuguese in Denmark"
>>
>>
>>
>>
>
>
Performing multiplication in web form??
if (txtQuantity.Text != null)
{
lblPrice.Text = intPrice * intQuantity;
}
I'm sure this is simple enough, but I'm new to ASP.NET and C# and not sure how this is supposed to work. Both values are coming from, as you can see, txtQuantity.text and lblPrice.text, both of which are strings. I found a couple of explanations about performing calculations online, but it was clearly written for more advanced users. A code sample would be great!
Take care
if (txtQuantity.Text != null)
{
lblPrice.Text = (intPrice * intQuantity).ToString();
}
How do I put txtQuantity.text and lblPrice.text into the variables. I just tried and I get an "cannot convert string to int" error.
Take care
long q=int.Parse(txtQuantity.Text);
long p=int.Parse(txtPrice.Text);
Note that int.Parse() will throw an exception if txtQuantity.Text is, say, "Fred" or "Hi" rather than something that can be parsed as a number.
perl and asp.net
http://aspn.activestate.com/ASPN/Downloads/PerlASPX/
Hello ADEC:
It was a nice link. In fact combinning these two technologies is something great. I wanted to ask you, what do you think of MONO project, have you heard of it ? It allows ASP.NET to run under UNIX enviroments.
regards.
Saturday, March 24, 2012
Permission denied problem. please help me
I am trying to download the file from network machine (under same domain). I
am using below link page code to impersonate.
http://www.netomatix.com/ImpersonateUser.aspx
I can able to impersonate the user, when i try to download the file, its
says "unknown user name and password". I given full permission to domain
user. but the same time when i provied the user name and deails on webconfig
file like below, its allowing me to download.
<identity impersonate="true" userName="mydomain\bala" password="password" /
I dont know where the problem is. Can anyone please give me idea to resolve
this.
I am trying to fix this problem past 3 days.
below is the complete code i am using...
i am getting error on response.writefile. This is the error message
Logon failure: unknown user name or bad password.
exception Details: System.IO.IOException: Logon failure: unknown user name
or bad password.
code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim impContext As WindowsImpersonationContext = Nothing
Try
impContext = NetworkSecurity.ImpersonateUser("mydomain",
"bala", "password", LogonType.LOGON32_LOGON_NETWORK,
LogonProvider.LOGON32_PROVIDER_DEFAULT)
Catch ex As ApplicationException
impContext.Undo()
Response.Write(ex.Message)
End Try
If Not (Nothing Is impContext) Then
Try
Catch ex As Exception
Response.Write(ex.Message)
Finally
impContext.Undo()
If Page.IsPostBack Then
Dim spath As String
spath = "\\laptop02\temp\test.pdf"
'DownloadFile(spath, True)
Dim path1 As String = spath
Dim name As String = Path.GetFileName(path1)
Dim ext As String = Path.GetExtension(path1)
Dim type As String = ""
If Not (ext Is Nothing) Then
Select Case ext.ToLower
Case ".htm", ".html"
type = "text/HTML"
' break
Case ".txt"
type = "text/plain"
' break
Case ".doc", ".rtf"
type = "Application/msword"
' break
Case ".pdf"
type = "Application/pdf"
End Select
End If
'If forceDownload Then
Response.AppendHeader("content-disposition",
"attachment; filename = " & name)
'End If
If Not (type = "") Then
Response.ContentType = type
End If
Response.WriteFile(path1)
Response.End()
End If
End Try
End If
End Sub
thanks
balaImpersonation only allows access to local resources as the user who's using
your site. You want delegation which will allow off-host access as the user
who has authenticated in the browser. In essence it means you need to enable
this in AD for the machine that's running your webserver. Check out this
for more info:
http://pluralsite.com/wiki/default...Delegation.html
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hi All,
> I am trying to download the file from network machine (under same
> domain). I am using below link page code to impersonate.
> http://www.netomatix.com/ImpersonateUser.aspx
> I can able to impersonate the user, when i try to download the file,
> its says "unknown user name and password". I given full permission to
> domain user. but the same time when i provied the user name and deails
> on webconfig file like below, its allowing me to download.
> <identity impersonate="true" userName="mydomain\bala"
> password="password" />
> I dont know where the problem is. Can anyone please give me idea to
> resolve this. I am trying to fix this problem past 3 days.
> below is the complete code i am using...
> i am getting error on response.writefile. This is the error message
> Logon failure: unknown user name or bad password. exception Details:
> System.IO.IOException: Logon failure: unknown user name or bad
> password.
> code:
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Dim impContext As WindowsImpersonationContext = Nothing
> Try
> impContext =
> NetworkSecurity.ImpersonateUser("mydomain",
> "bala", "password", LogonType.LOGON32_LOGON_NETWORK,
> LogonProvider.LOGON32_PROVIDER_DEFAULT)
> Catch ex As ApplicationException
> impContext.Undo()
> Response.Write(ex.Message)
> End Try
> If Not (Nothing Is impContext) Then
> Try
> Catch ex As Exception
> Response.Write(ex.Message)
> Finally
> impContext.Undo()
> If Page.IsPostBack Then
> Dim spath As String
> spath = "\\laptop02\temp\test.pdf"
> 'DownloadFile(spath, True)
> Dim path1 As String = spath
> Dim name As String = Path.GetFileName(path1)
> Dim ext As String = Path.GetExtension(path1)
> Dim type As String = ""
> If Not (ext Is Nothing) Then
> Select Case ext.ToLower
> Case ".htm", ".html"
> type = "text/HTML"
> ' break
> Case ".txt"
> type = "text/plain"
> ' break
> Case ".doc", ".rtf"
> type = "Application/msword"
> ' break
> Case ".pdf"
> type = "Application/pdf"
> End Select
> End If
> 'If forceDownload Then
> Response.AppendHeader("content-disposition",
> "attachment; filename = " & name)
> 'End If
> If Not (type = "") Then
> Response.ContentType = type
> End If
> Response.WriteFile(path1)
> Response.End()
> End If
> End Try
> End If
> End Sub
> thanks
> bala
Hi Brock,
Thanks for the reply. The user name which i am using is under the same
DOMAIN.
Are you mentioning the same domain user or local user for that machine?
Thanks
bala
"Brock Allen" wrote:
> Impersonation only allows access to local resources as the user who's using
> your site. You want delegation which will allow off-host access as the user
> who has authenticated in the browser. In essence it means you need to enable
> this in AD for the machine that's running your webserver. Check out this
> for more info:
> http://pluralsite.com/wiki/default...Delegation.html
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
> > Hi All,
> > I am trying to download the file from network machine (under same
> > domain). I am using below link page code to impersonate.
> > http://www.netomatix.com/ImpersonateUser.aspx
> > I can able to impersonate the user, when i try to download the file,
> > its says "unknown user name and password". I given full permission to
> > domain user. but the same time when i provied the user name and deails
> > on webconfig file like below, its allowing me to download.
> > <identity impersonate="true" userName="mydomain\bala"
> > password="password" />
> > I dont know where the problem is. Can anyone please give me idea to
> > resolve this. I am trying to fix this problem past 3 days.
> > below is the complete code i am using...
> > i am getting error on response.writefile. This is the error message
> > Logon failure: unknown user name or bad password. exception Details:
> > System.IO.IOException: Logon failure: unknown user name or bad
> > password.
> > code:
> > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles Button1.Click
> > Dim impContext As WindowsImpersonationContext = Nothing
> > Try
> > impContext =
> > NetworkSecurity.ImpersonateUser("mydomain",
> > "bala", "password", LogonType.LOGON32_LOGON_NETWORK,
> > LogonProvider.LOGON32_PROVIDER_DEFAULT)
> > Catch ex As ApplicationException
> > impContext.Undo()
> > Response.Write(ex.Message)
> > End Try
> > If Not (Nothing Is impContext) Then
> > Try
> > Catch ex As Exception
> > Response.Write(ex.Message)
> > Finally
> > impContext.Undo()
> > If Page.IsPostBack Then
> > Dim spath As String
> > spath = "\\laptop02\temp\test.pdf"
> > 'DownloadFile(spath, True)
> > Dim path1 As String = spath
> > Dim name As String = Path.GetFileName(path1)
> > Dim ext As String = Path.GetExtension(path1)
> > Dim type As String = ""
> > If Not (ext Is Nothing) Then
> > Select Case ext.ToLower
> > Case ".htm", ".html"
> > type = "text/HTML"
> > ' break
> > Case ".txt"
> > type = "text/plain"
> > ' break
> > Case ".doc", ".rtf"
> > type = "Application/msword"
> > ' break
> > Case ".pdf"
> > type = "Application/pdf"
> > End Select
> > End If
> > 'If forceDownload Then
> > Response.AppendHeader("content-disposition",
> > "attachment; filename = " & name)
> > 'End If
> > If Not (type = "") Then
> > Response.ContentType = type
> > End If
> > Response.WriteFile(path1)
> > Response.End()
> > End If
> > End Try
> > End If
> > End Sub
> > thanks
> > bala
>
>
> Thanks for the reply. The user name which i am using is under the same
> DOMAIN.
Ok, that shouldn't matter with delegation.
> Are you mentioning the same domain user or local user for that
> machine?
For delegation you'll have to be using kerb. The username doesn't matter,
the important thing is to configure the server to be trusted for delegation.
-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi Brock,
Using this below link code i can able to impersonate the user on my domain
user account. From my locl machine IIS i can able to download the other
machine file, like below path.
("AnotherNetworkMachine\temp\ss.pdf")
But when i place this code my server, the impersonate is doing succuss, but
its taking too much time to download and finally it says page cannot be
displayed error.
any idea.
bala
http://west-wind.com/weblog/posts/1572.aspx
"Brock Allen" wrote:
> > Thanks for the reply. The user name which i am using is under the same
> > DOMAIN.
> Ok, that shouldn't matter with delegation.
> > Are you mentioning the same domain user or local user for that
> > machine?
> For delegation you'll have to be using kerb. The username doesn't matter,
> the important thing is to configure the server to be trusted for delegation.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
Hi Brock,
If i create a local account on webserver and same username and password for
network machine to local, In this point can i able to download the file?
thanks
bala
"Brock Allen" wrote:
> > Thanks for the reply. The user name which i am using is under the same
> > DOMAIN.
> Ok, that shouldn't matter with delegation.
> > Are you mentioning the same domain user or local user for that
> > machine?
> For delegation you'll have to be using kerb. The username doesn't matter,
> the important thing is to configure the server to be trusted for delegation.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
sorry. when i run the application on same domain its download the file. but
from outside i am getting error. so that wont work.
bala
"Bala" wrote:
> Hi Brock,
> Using this below link code i can able to impersonate the user on my domain
> user account. From my locl machine IIS i can able to download the other
> machine file, like below path.
> ("AnotherNetworkMachine\temp\ss.pdf")
> But when i place this code my server, the impersonate is doing succuss, but
> its taking too much time to download and finally it says page cannot be
> displayed error.
> any idea.
> bala
> http://west-wind.com/weblog/posts/1572.aspx
> "Brock Allen" wrote:
> > > Thanks for the reply. The user name which i am using is under the same
> > > DOMAIN.
> > Ok, that shouldn't matter with delegation.
> > > Are you mentioning the same domain user or local user for that
> > > machine?
> > For delegation you'll have to be using kerb. The username doesn't matter,
> > the important thing is to configure the server to be trusted for delegation.
> > -Brock
> > DevelopMentor
> > http://staff.develop.com/ballen
On Mon, 29 Aug 2005 13:45:32 -0700, "Bala" <Bala@.discussions.microsoft.com> wrote:
Hi Brock,
If i create a local account on webserver and same username and password for
network machine to local, In this point can i able to download the file?
As Brock was indicating, you need to delegate credentials which requires Kerberos if your web
application is configured for Integrated Windows Security.
How to configure an ASP.NET application for a delegation scenario
http://support.microsoft.com/defaul...kb;en-us;810572
Paul
~~~~
Microsoft MVP (Visual Basic)
Permission denied problem. please help me
I am trying to download the file from network machine (under same domain). I
am using below link page code to impersonate.
http://www.netomatix.com/ImpersonateUser.aspx
I can able to impersonate the user, when i try to download the file, its
says "unknown user name and password". I given full permission to domain
user. but the same time when i provied the user name and deails on webconfig
file like below, its allowing me to download.
<identity impersonate="true" userName="mydomain\bala" password="password" />
I dont know where the problem is. Can anyone please give me idea to resolve
this.
I am trying to fix this problem past 3 days.
below is the complete code i am using...
i am getting error on response.writefile. This is the error message
Logon failure: unknown user name or bad password.
exception Details: System.IO.IOException: Logon failure: unknown user name
or bad password.
code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim impContext As WindowsImpersonationContext = Nothing
Try
impContext = NetworkSecurity.ImpersonateUser("mydomain",
"bala", "password", LogonType.LOGON32_LOGON_NETWORK,
LogonProvider.LOGON32_PROVIDER_DEFAULT)
Catch ex As ApplicationException
impContext.Undo()
Response.Write(ex.Message)
End Try
If Not (Nothing Is impContext) Then
Try
Catch ex As Exception
Response.Write(ex.Message)
Finally
impContext.Undo()
If Page.IsPostBack Then
Dim spath As String
spath = "\\laptop02\temp\test.pdf"
'DownloadFile(spath, True)
Dim path1 As String = spath
Dim name As String = Path.GetFileName(path1)
Dim ext As String = Path.GetExtension(path1)
Dim type As String = ""
If Not (ext Is Nothing) Then
Select Case ext.ToLower
Case ".htm", ".html"
type = "text/HTML"
' break
Case ".txt"
type = "text/plain"
' break
Case ".doc", ".rtf"
type = "Application/msword"
' break
Case ".pdf"
type = "Application/pdf"
End Select
End If
'If forceDownload Then
Response.AppendHeader("content-disposition",
"attachment; filename = " & name)
'End If
If Not (type = "") Then
Response.ContentType = type
End If
Response.WriteFile(path1)
Response.End()
End If
End Try
End If
End Sub
thanks
balaImpersonation only allows access to local resources as the user who's using
your site. You want delegation which will allow off-host access as the user
who has authenticated in the browser. In essence it means you need to enable
this in AD for the machine that's running your webserver. Check out this
for more info:
http://pluralsite.com/wiki/default...elop.com/ballen
> Hi All,
> I am trying to download the file from network machine (under same
> domain). I am using below link page code to impersonate.
> http://www.netomatix.com/ImpersonateUser.aspx
> I can able to impersonate the user, when i try to download the file,
> its says "unknown user name and password". I given full permission to
> domain user. but the same time when i provied the user name and deails
> on webconfig file like below, its allowing me to download.
> <identity impersonate="true" userName="mydomain\bala"
> password="password" />
> I dont know where the problem is. Can anyone please give me idea to
> resolve this. I am trying to fix this problem past 3 days.
> below is the complete code i am using...
> i am getting error on response.writefile. This is the error message
> Logon failure: unknown user name or bad password. exception Details:
> System.IO.IOException: Logon failure: unknown user name or bad
> password.
> code:
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Dim impContext As WindowsImpersonationContext = Nothing
> Try
> impContext =
> NetworkSecurity.ImpersonateUser("mydomain",
> "bala", "password", LogonType.LOGON32_LOGON_NETWORK,
> LogonProvider.LOGON32_PROVIDER_DEFAULT)
> Catch ex As ApplicationException
> impContext.Undo()
> Response.Write(ex.Message)
> End Try
> If Not (Nothing Is impContext) Then
> Try
> Catch ex As Exception
> Response.Write(ex.Message)
> Finally
> impContext.Undo()
> If Page.IsPostBack Then
> Dim spath As String
> spath = "\\laptop02\temp\test.pdf"
> 'DownloadFile(spath, True)
> Dim path1 As String = spath
> Dim name As String = Path.GetFileName(path1)
> Dim ext As String = Path.GetExtension(path1)
> Dim type As String = ""
> If Not (ext Is Nothing) Then
> Select Case ext.ToLower
> Case ".htm", ".html"
> type = "text/HTML"
> ' break
> Case ".txt"
> type = "text/plain"
> ' break
> Case ".doc", ".rtf"
> type = "Application/msword"
> ' break
> Case ".pdf"
> type = "Application/pdf"
> End Select
> End If
> 'If forceDownload Then
> Response.AppendHeader("content-disposition",
> "attachment; filename = " & name)
> 'End If
> If Not (type = "") Then
> Response.ContentType = type
> End If
> Response.WriteFile(path1)
> Response.End()
> End If
> End Try
> End If
> End Sub
> thanks
> bala
Hi Brock,
Thanks for the reply. The user name which i am using is under the same
DOMAIN.
Are you mentioning the same domain user or local user for that machine?
Thanks
bala
"Brock Allen" wrote:
> Impersonation only allows access to local resources as the user who's usin
g
> your site. You want delegation which will allow off-host access as the use
r
> who has authenticated in the browser. In essence it means you need to enab
le
> this in AD for the machine that's running your webserver. Check out this
> for more info:
> http://pluralsite.com/wiki/default...elop.com/ballen
>
>
>
>
> Thanks for the reply. The user name which i am using is under the same
> DOMAIN.
Ok, that shouldn't matter with delegation.
> Are you mentioning the same domain user or local user for that
> machine?
For delegation you'll have to be using kerb. The username doesn't matter,
the important thing is to configure the server to be trusted for delegation.
-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi Brock,
Using this below link code i can able to impersonate the user on my domain
user account. From my locl machine IIS i can able to download the other
machine file, like below path.
("AnotherNetworkMachine\temp\ss.pdf")
But when i place this code my server, the impersonate is doing succuss, but
its taking too much time to download and finally it says page cannot be
displayed error.
any idea.
bala
http://west-wind.com/weblog/posts/1572.aspx
"Brock Allen" wrote:
> Ok, that shouldn't matter with delegation.
>
> For delegation you'll have to be using kerb. The username doesn't matter,
> the important thing is to configure the server to be trusted for delegatio
n.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
Hi Brock,
If i create a local account on webserver and same username and password for
network machine to local, In this point can i able to download the file?
thanks
bala
"Brock Allen" wrote:
> Ok, that shouldn't matter with delegation.
>
> For delegation you'll have to be using kerb. The username doesn't matter,
> the important thing is to configure the server to be trusted for delegatio
n.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
sorry. when i run the application on same domain its download the file. but
from outside i am getting error. so that wont work.
bala
"Bala" wrote:
> Hi Brock,
> Using this below link code i can able to impersonate the user on my domain
> user account. From my locl machine IIS i can able to download the other
> machine file, like below path.
> ("AnotherNetworkMachine\temp\ss.pdf")
> But when i place this code my server, the impersonate is doing succuss, bu
t
> its taking too much time to download and finally it says page cannot be
> displayed error.
> any idea.
> bala
> http://west-wind.com/weblog/posts/1572.aspx
> "Brock Allen" wrote:
>
On Mon, 29 Aug 2005 13:45:32 -0700, "Bala" <Bala@.discussions.microsoft.com>
wrote:
Hi Brock,
If i create a local account on webserver and same username and password fo
r
network machine to local, In this point can i able to download the file?
As Brock was indicating, you need to delegate credentials which requires Ker
beros if your web
application is configured for Integrated Windows Security.
How to configure an ASP.NET application for a delegation scenario
http://support.microsoft.com/defaul...kb;en-us;810572
Paul
~~~~
Microsoft MVP (Visual Basic)
Permission Issue
"db" directory off the root of the web site. In my Inetpub/myproj I added
the directory but cannot figure out how to give the application authority to
write into that directory. I get the error:
System.UnauthorizedAccessException: Access to the path
"c:\inetpub\wwwroot\OfficeApp\db\judgedata.csv" is denied.
In the error information it says to grant ASP.NET write access to a file,
right-click the file in Explorer, choose "Properties" and select the
Security tab. There is no "Security" tab. I must be missing something here?
How do I set that directory to allow asp.net to write to it?
Wayne"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:uaqU3wViFHA.3568@.TK2MSFTNGP10.phx.gbl...
> Security tab. There is no "Security" tab. I must be missing something
> here?
Uncheck the "Use simple file sharing" (bottom option) in the "View" tab of
the "Folder Options" dialog.
John
Thanks for the suggestion but after doing that I still get the same error?
Wayne
"WJ" <JohnWebbs@.HotMail.Com> wrote in message
news:eTlcryWiFHA.1460@.tk2msftngp13.phx.gbl...
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:uaqU3wViFHA.3568@.TK2MSFTNGP10.phx.gbl...
>> Security tab. There is no "Security" tab. I must be missing something
>> here?
> Uncheck the "Use simple file sharing" (bottom option) in the "View" tab of
> the "Folder Options" dialog.
> John
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:OV5Ov3WiFHA.1148@.TK2MSFTNGP12.phx.gbl...
> Thanks for the suggestion but after doing that I still get the same error?
This only lets you use the "Security" tab on the Windows Explorer. To fix
the error (access denied), you must grant r/w access to the account that
runs your website to the database file where your data resides.
John
John;
Thanks for the clarification. I did that and gave ASP.NET full control of
that directory but it still gives the same error when the code attempts to
create a file in that directory?
Wayne
"WJ" <JohnWebbs@.HotMail.Com> wrote in message
news:Og0ICGXiFHA.3544@.TK2MSFTNGP15.phx.gbl...
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:OV5Ov3WiFHA.1148@.TK2MSFTNGP12.phx.gbl...
>> Thanks for the suggestion but after doing that I still get the same
>> error?
>>
> This only lets you use the "Security" tab on the Windows Explorer. To fix
> the error (access denied), you must grant r/w access to the account that
> runs your website to the database file where your data resides.
> John
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
> John;
> Thanks for the clarification. I did that and gave ASP.NET full control of
> that directory but it still gives the same error when the code attempts to
> create a file in that directory?
Check your local website (IIS/MMC) to find out what account is configured
for the web site, then grant FC to that account. Example: If you allow
"Anonymous" access to the web site, then the User Account box likely shows
"IUSR_YourPCName". Try that see what happens.
John
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
> John;
> Thanks for the clarification. I did that and gave ASP.NET full control of
> that directory but it still gives the same error when the code attempts to
> create a file in that directory?
Check your local website (IIS/MMC) to find out what account is configured
for the web site, then grant FC to that account. Example: If you allow
"Anonymous" access to the web site, then the User Account box likely shows
"IUSR_YourPCName". Try that see what happens.
John
John;
Thanks for the continued help. I am not sure how to determine which account
is configured for the web site (I thought ASP.NET was always used by VSNET
projects?) I went to Control Panel/Administrative Tools/IIS and Properties
but I don't see how to determine the default user for a web site?
Wayne
"WJ" <JohnWebbs@.HotMail.Com> wrote in message
news:eJobGXXiFHA.3936@.TK2MSFTNGP10.phx.gbl...
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
>> John;
>>
>> Thanks for the clarification. I did that and gave ASP.NET full control of
>> that directory but it still gives the same error when the code attempts
>> to create a file in that directory?
>>
> Check your local website (IIS/MMC) to find out what account is configured
> for the web site, then grant FC to that account. Example: If you allow
> "Anonymous" access to the web site, then the User Account box likely shows
> "IUSR_YourPCName". Try that see what happens.
> John
Hi, Wayne.
This all boils down to giving the account ASP.NET is running
under, *whichever account that is* the necessary permissions.
If you have doubts about which account ASP.NET is running under,
just run this short script. It will identify ASP.NET's current identity.
identity.aspx
----
<%@. Page Language="VB" %>
<%@. Import NameSpace = System.Security.Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity.GetCurrent.Name()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsIdentity.GetCurrent.Name()</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
---
Hope this helps...
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:uAtm5ffiFHA.3448@.TK2MSFTNGP12.phx.gbl...
> John;
> Thanks for the continued help. I am not sure how to determine which account is
> configured for the web site (I thought ASP.NET was always used by VSNET projects?) I
> went to Control Panel/Administrative Tools/IIS and Properties but I don't see how to
> determine the default user for a web site?
> Wayne
> "WJ" <JohnWebbs@.HotMail.Com> wrote in message
> news:eJobGXXiFHA.3936@.TK2MSFTNGP10.phx.gbl...
>>
>> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
>> news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
>>> John;
>>>
>>> Thanks for the clarification. I did that and gave ASP.NET full control of that
>>> directory but it still gives the same error when the code attempts to create a file in
>>> that directory?
>>>
>>
>> Check your local website (IIS/MMC) to find out what account is configured for the web
>> site, then grant FC to that account. Example: If you allow "Anonymous" access to the
>> web site, then the User Account box likely shows "IUSR_YourPCName". Try that see what
>> happens.
>>
>> John
>>
>>
Juan;
Thanks for that page. That is a handy little tool to have. It revealed that
the account used is "myMachine/ASPNET" (no ".") I gave that FC but it still
gives me the erron on my local machine - it works fine on my real web site.
Wayne
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:eVXEvCgiFHA.1444@.TK2MSFTNGP10.phx.gbl...
> Hi, Wayne.
> This all boils down to giving the account ASP.NET is running
> under, *whichever account that is* the necessary permissions.
> If you have doubts about which account ASP.NET is running under,
> just run this short script. It will identify ASP.NET's current identity.
> identity.aspx
> ----
> <%@. Page Language="VB" %>
> <%@. Import NameSpace = System.Security.Principal %>
> <script runat="server">
> Sub Page_Load()
> Dim tmp As String = WindowsIdentity.GetCurrent.Name()
> Label1.Text = tmp
> End Sub
> </script>
> <html>
> <head>
> <title>WindowsIdentity.GetCurrent.Name()</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
> </div>
> </form>
> </body>
> </html>
> ---
> Hope this helps...
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:uAtm5ffiFHA.3448@.TK2MSFTNGP12.phx.gbl...
>> John;
>>
>> Thanks for the continued help. I am not sure how to determine which
>> account is configured for the web site (I thought ASP.NET was always used
>> by VSNET projects?) I went to Control Panel/Administrative Tools/IIS and
>> Properties but I don't see how to determine the default user for a web
>> site?
>>
>> Wayne
>>
>> "WJ" <JohnWebbs@.HotMail.Com> wrote in message
>> news:eJobGXXiFHA.3936@.TK2MSFTNGP10.phx.gbl...
>>>
>>> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
>>> news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
>>>> John;
>>>>
>>>> Thanks for the clarification. I did that and gave ASP.NET full control
>>>> of that directory but it still gives the same error when the code
>>>> attempts to create a file in that directory?
>>>>
>>>
>>> Check your local website (IIS/MMC) to find out what account is
>>> configured for the web site, then grant FC to that account. Example: If
>>> you allow "Anonymous" access to the web site, then the User Account box
>>> likely shows "IUSR_YourPCName". Try that see what happens.
>>>
>>> John
>>>
>>>
>>
>>
Permission issue with SQLDataSource?
database with SQLDataSource in regards to permissions. In the
Page_Load(), my code looks similar to this (sorry, I don't have the
code with me now):
SqlDataSource mysource = new SqlDataSource("SQLClient", myconn,
CommandType.Text );
mysource.Insert( );
The above works fine when I'm local (192.168.1.100) but once I try to
access from the outside, it fails. I'm guessing perhaps because some
type of ASPNET user is not added into SQL Server 2005 users and does
not have access to the table. What are the correct steps to allow the
code to run?
I will be using a stored procedure in place of text.
Thanks,
johnYour guess sounds right. You need to setup proper database connection.
Either introduce the asp.net user to the sql server and use windows
authentication or use sql authentication with user name and password.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"perplexed" <johnc@.bigstring.comwrote in message
news:1169592074.377111.113560@.j27g2000cwj.googlegr oups.com...
Quote:
Originally Posted by
I'd like a small overview of requirements for inserting data into a
database with SQLDataSource in regards to permissions. In the
Page_Load(), my code looks similar to this (sorry, I don't have the
code with me now):
>
SqlDataSource mysource = new SqlDataSource("SQLClient", myconn,
CommandType.Text );
mysource.Insert( );
>
The above works fine when I'm local (192.168.1.100) but once I try to
access from the outside, it fails. I'm guessing perhaps because some
type of ASPNET user is not added into SQL Server 2005 users and does
not have access to the table. What are the correct steps to allow the
code to run?
>
I will be using a stored procedure in place of text.
>
Thanks,
john
>
Thanks. I added correct permissions for network service account.
That's ok since this is local.