Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Saturday, March 31, 2012

Set a icon to a web application

Hi,
I would like to set an different icon, than explorer icon, to my web
application. When we visit a web page, usually in address bar appears IE
icon before the address. What I want is to substitute that icon to another,
like happens when we visit, for example, http://www.codeproject.com .
How can I do that?
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
rucai dont see any difference for www.codeproject.com
Av.
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
> another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
Hi Ruca,
Do you mean the favorite.ico have a look for that on Google.
Cor
Try something like
<link rel="icon" href="http://links.10026.com/?link=/favicon.ico" type="image/ico">
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
ruca wrote:
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears
> IE icon before the address. What I want is to substitute that icon to
> another, like happens when we visit, for example,
> http://www.codeproject.com .
> How can I do that?
This has nothing to do with ASP.NET, it's just a feature in Internet
Explorer.
You only have to provide an icon with a specific format and name
in the root of your website.
For more information, do a Google search for "favicon".
Jos
Hi
http://www.favicon.com/
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/
http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground: http://213.190.104.211/ ( IE 5.5+ only )
No matter where you go there you are
==============================
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
> another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
Yes, that's it.
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Cor Ligthert" <notfirstname@.planet.nl> escreveu na mensagem
news:eZp2EnvREHA.1388@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> Do you mean the favorite.ico have a look for that on Google.
> Cor
>
I think that this don't work very well with IE 6.0
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Cor Ligthert" <notfirstname@.planet.nl> escreveu na mensagem
news:eZp2EnvREHA.1388@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> Do you mean the favorite.ico have a look for that on Google.
> Cor
>
Hi Ruca,
You are right, when you delete the cache from IE 6.0 it is gone. However
that is in my opinion an IE bug. It is with all favicons. I thought that in
Mozilla and Netscape it stays.
I made a mistake it has to be favicon instead of favorite as others wrote,
sorry for that.
Cor
"Cor Ligthert" <notfirstname@.planet.nl> wrote in message news:upVR1h8REHA.3840@.TK2MSFTNGP09
.phx.gbl...
> Hi Ruca,
> You are right, when you delete the cache from IE 6.0 it is gone. However
> that is in my opinion an IE bug. It is with all favicons. I thought that i
n
> Mozilla and Netscape it stays.
> I made a mistake it has to be favicon instead of favorite as others wrote,
> sorry for that.
> Cor
>
A tip: look for the utility FavOrg, it downloads all favicons for your
favorites and preserves them outside of the browsercache.
Hans Kesting

Set a icon to a web application

Hi,

I would like to set an different icon, than explorer icon, to my web
application. When we visit a web page, usually in address bar appears IE
icon before the address. What I want is to substitute that icon to another,
like happens when we visit, for example, http://www.codeproject.com .
How can I do that?

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
rucai dont see any difference for www.codeproject.com

Av.
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
> another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
Hi Ruca,

Do you mean the favorite.ico have a look for that on Google.

Cor
Try something like

<link rel="icon" href="http://links.10026.com/?link=/favicon.ico" type="image/ico"
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
ruca wrote:
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears
> IE icon before the address. What I want is to substitute that icon to
> another, like happens when we visit, for example,
> http://www.codeproject.com .
> How can I do that?

This has nothing to do with ASP.NET, it's just a feature in Internet
Explorer.

You only have to provide an icon with a specific format and name
in the root of your website.

For more information, do a Google search for "favicon".

--

Jos
Hi

http://www.favicon.com/

--
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/
http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground: http://213.190.104.211/ ( IE 5.5+ only )

No matter where you go there you are
==============================
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
> another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
Yes, that's it.

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Cor Ligthert" <notfirstname@.planet.nl> escreveu na mensagem
news:eZp2EnvREHA.1388@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> Do you mean the favorite.ico have a look for that on Google.
> Cor
I think that this don't work very well with IE 6.0

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Cor Ligthert" <notfirstname@.planet.nl> escreveu na mensagem
news:eZp2EnvREHA.1388@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> Do you mean the favorite.ico have a look for that on Google.
> Cor
Hi Ruca,

You are right, when you delete the cache from IE 6.0 it is gone. However
that is in my opinion an IE bug. It is with all favicons. I thought that in
Mozilla and Netscape it stays.

I made a mistake it has to be favicon instead of favorite as others wrote,
sorry for that.

Cor
"Cor Ligthert" <notfirstname@.planet.nl> wrote in message news:upVR1h8REHA.3840@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> You are right, when you delete the cache from IE 6.0 it is gone. However
> that is in my opinion an IE bug. It is with all favicons. I thought that in
> Mozilla and Netscape it stays.
> I made a mistake it has to be favicon instead of favorite as others wrote,
> sorry for that.
> Cor

A tip: look for the utility FavOrg, it downloads all favicons for your
favorites and preserves them outside of the browsercache.

Hans Kesting
In article <uv0VIfvREHA.3348@.TK2MSFTNGP09.phx.gbl>, avn@.newsgroups.com
says...
> i dont see any difference for www.codeproject.com
> Av.
> "ruca" <ruuca@.iol.pt> wrote in message
> news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> > Hi,
> > I would like to set an different icon, than explorer icon, to my web
> > application. When we visit a web page, usually in address bar appears IE
> > icon before the address. What I want is to substitute that icon to
> > another,
> > like happens when we visit, for example, http://www.codeproject.com .
> > How can I do that?
> > --
> > Programming ASP.NET with VB.NET
> > Thank's (if you try to help me)
> > Hope this help you (if I try to help you)
> > ruca
>
It works find in Opera and Mozila. IE has not caught up!

Set application variable from a class

Hi
I am trying to set an application variable from a class file in my website.
Currently, the class file inherits from System.Web.UI.Page
I also referenced all the namespaces a normal webform would.
However, when i try save my application variable like such:
Application["test"] = "hello";
I get the following error:
Object reference not set to an instance of an object
How can i set an application variable from a class
It works fine from a webform
TIA
GrantGot It
HttpContext.Current.Application[ ...
"Grant Merwitz" <grant@.workshare.com> wrote in message
news:%23hZBPQ9NGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Hi
> I am trying to set an application variable from a class file in my
> website.
> Currently, the class file inherits from System.Web.UI.Page
> I also referenced all the namespaces a normal webform would.
> However, when i try save my application variable like such:
> Application["test"] = "hello";
> I get the following error:
> Object reference not set to an instance of an object
> How can i set an application variable from a class
> It works fine from a webform
> TIA
> Grant
>

Set application variable from a class

Hi

I am trying to set an application variable from a class file in my website.

Currently, the class file inherits from System.Web.UI.Page
I also referenced all the namespaces a normal webform would.

However, when i try save my application variable like such:
Application["test"] = "hello";
I get the following error:
Object reference not set to an instance of an object

How can i set an application variable from a class
It works fine from a webform

TIA

GrantGot It

HttpContext.Current.Application[ ...

"Grant Merwitz" <grant@.workshare.com> wrote in message
news:%23hZBPQ9NGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Hi
> I am trying to set an application variable from a class file in my
> website.
> Currently, the class file inherits from System.Web.UI.Page
> I also referenced all the namespaces a normal webform would.
> However, when i try save my application variable like such:
> Application["test"] = "hello";
> I get the following error:
> Object reference not set to an instance of an object
> How can i set an application variable from a class
> It works fine from a webform
> TIA
> Grant

Set application timeout to more than 3 minutes

I have a custom VB.net application that runs a query against an SQL
server that takes more than 3 minutes. Right now after 3 minutes it
times out. So far after doing my research I have changed the following:

in web.config:
<system.web>

<httpRuntime executionTimeout="1000" maxRequestLength="2000000"/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="600"/>

In the page itself:

Me.SqlConnection1.ConnectionString = "workstation id=OBANG;packet
size=4096;user id=sa;data source=OBANG;persist securi" & _
"ty info=False;initial catalog=YZA; Connect Timeout=600 "
Me.SqlSelectCommand1.CommandTimeout = 600

The page still times out after 3 min. Is there anything that I am
missing?

Thanks in advance.dadocsis wrote:

Quote:

Originally Posted by

I have a custom VB.net application that runs a query against an SQL
server that takes more than 3 minutes. Right now after 3 minutes it
times out. So far after doing my research I have changed the following:
>
in web.config:
<system.web>
>
<httpRuntime executionTimeout="1000" maxRequestLength="2000000"/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="600"/>
>
In the page itself:
>
Me.SqlConnection1.ConnectionString = "workstation id=OBANG;packet
size=4096;user id=sa;data source=OBANG;persist securi" & _
"ty info=False;initial catalog=YZA; Connect Timeout=600 "
Me.SqlSelectCommand1.CommandTimeout = 600
>
>
The page still times out after 3 min. Is there anything that I am
missing?
>
Thanks in advance.
>


If memory serves me right, there is a connection timeout setting in
mssql thats in seconds; What is yours set to?

Joe (MCAD)
Hi,

Would you please post the detailed exception when the page times out? Try
to visit it on localhost so that you can see the detailed exception.

I think this might not be related to the sql query's time out settings.
Anyway, let's see the exception first.

Sincerely,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...rt/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Sorry it took me so long to write back. Yesterday was hectic.

I didnt mention that I already set the SQL server query timeout to 600
sec.

Here is the detailed exception:

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

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.
The timeout period elapsed prior to completion of the operation or the
server is not responding.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
behavior) +45

System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.ExecuteReader(CommandBehavior
behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
YZA_Remote.OrderControl.InitGridData() +8219
YZA_Remote.OrderControl.btnFetchNewData_Click(Obje ct sender,
EventArgs e) +49
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1273

Walter Wang [MSFT] wrote:

Quote:

Originally Posted by

Hi,
>
Would you please post the detailed exception when the page times out? Try
to visit it on localhost so that you can see the detailed exception.
>
I think this might not be related to the sql query's time out settings.
Anyway, let's see the exception first.
>
Sincerely,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
>
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.
>
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...rt/default.aspx.
==================================================
>
This posting is provided "AS IS" with no warranties, and confers no rights.


Hi,

Hope you're better now.

For page execution time out setting, it's only effective in Release mode:

#httpRuntime Element (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/library/e1f13641.aspx
executionTimeoutOptional TimeSpan attribute.

Specifies the maximum number of seconds that a request is allowed to
execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation
element is False. To help to prevent shutting down the application while
you are debugging, do not set this time-out to a large value.

The default is "00:01:50" (110 seconds).Note

In the .NET Framework 1.0 and 1.1, the default is 90.
#############

From the exception and stack trace, it seems related to ADO.NET query timed
out. To confirm this issue is not related to ASP.NET, try to issue the
query in a WinForm or Console application. Normally you only need to set
the connection time out in the connection string and you set the command
time out in CommandTimeOut property. This should work as expected. Anyway,
let's first narrow down the issue to see if it's related to ASP.NET or not.

Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks 4 the response. Can I run the query in "Query analyzer?"

Walter Wang [MSFT] wrote:

Quote:

Originally Posted by

Hi,
>
Hope you're better now.
>
For page execution time out setting, it's only effective in Release mode:
>
#httpRuntime Element (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/library/e1f13641.aspx
executionTimeoutOptional TimeSpan attribute.
>
Specifies the maximum number of seconds that a request is allowed to
execute before being automatically shut down by ASP.NET.
>
This time-out applies only if the debug attribute in the compilation
element is False. To help to prevent shutting down the application while
you are debugging, do not set this time-out to a large value.
>
The default is "00:01:50" (110 seconds).Note
>
In the .NET Framework 1.0 and 1.1, the default is 90.
#############
>
>
From the exception and stack trace, it seems related to ADO.NET query timed
out. To confirm this issue is not related to ASP.NET, try to issue the
query in a WinForm or Console application. Normally you only need to set
the connection time out in the connection string and you set the command
time out in CommandTimeOut property. This should work as expected. Anyway,
let's first narrow down the issue to see if it's related to ASP.NET or not.
>
>
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
>
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
>
This posting is provided "AS IS" with no warranties, and confers no rights.


I suggest create a simple Console application and use the same database
access code in your web application to test it, this way we could know if
it's related to ASP.NET or not.

Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] wrote:

Quote:

Originally Posted by

I suggest create a simple Console application and use the same database
access code in your web application to test it, this way we could know if
it's related to ASP.NET or not.
>
>
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
>
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
>
This posting is provided "AS IS" with no warranties, and confers no rights.


Walter Sorry for the delayed response again. I am going to have to hold
off on this for a little while. I am not a programmer I just have a
little light programming experience with VB based languages. The
program was initially created by an experienced coder and due to $ my
company doesnt want to hire him again to fix this problem so this is
why I am stuck with it. The query comes from a complex stored
proceedure that is like 10 pages long! It will take me some time to
build a Console app. so I will have to hold off on this when I am not
so busy. Thanks for your time.

Set application timeout to more than 3 minutes

I have a custom VB.net application that runs a query against an SQL
server that takes more than 3 minutes. Right now after 3 minutes it
times out. So far after doing my research I have changed the following:
in web.config:
<system.web>
<httpRuntime executionTimeout="1000" maxRequestLength="2000000"/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="600"/>
In the page itself:
Me.SqlConnection1.ConnectionString = "workstation id=OBANG;packet
size=4096;user id=sa;data source=OBANG;persist securi" & _
"ty info=False;initial catalog=YZA; Connect Timeout=600 "
Me.SqlSelectCommand1.CommandTimeout = 600
The page still times out after 3 min. Is there anything that I am
missing?
Thanks in advance.dadocsis wrote:
> I have a custom VB.net application that runs a query against an SQL
> server that takes more than 3 minutes. Right now after 3 minutes it
> times out. So far after doing my research I have changed the following:
> in web.config:
> <system.web>
> <httpRuntime executionTimeout="1000" maxRequestLength="2000000"/>
> <sessionState
> mode="InProc"
> stateConnectionString="tcpip=127.0.0.1:42424"
> sqlConnectionString="data
> source=127.0.0.1;Trusted_Connection=yes"
> cookieless="false"
> timeout="600"/>
> In the page itself:
> Me.SqlConnection1.ConnectionString = "workstation id=OBANG;packet
> size=4096;user id=sa;data source=OBANG;persist securi" & _
> "ty info=False;initial catalog=YZA; Connect Timeout=600 "
> Me.SqlSelectCommand1.CommandTimeout = 600
>
> The page still times out after 3 min. Is there anything that I am
> missing?
> Thanks in advance.
>
If memory serves me right, there is a connection timeout setting in
mssql thats in seconds; What is yours set to?
Joe (MCAD)
Hi,
Would you please post the detailed exception when the page times out? Try
to visit it on localhost so that you can see the detailed exception.
I think this might not be related to the sql query's time out settings.
Anyway, let's see the exception first.
Sincerely,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Sorry it took me so long to write back. Yesterday was hectic.
I didnt mention that I already set the SQL server query timeout to 600
sec.
Here is the detailed exception:
Server Error in '/YZA_Remote' Application.
----
--
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Timeout expired.
The timeout period elapsed prior to completion of the operation or the
server is not responding.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior) +45
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(Comman
dBehavior
behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
YZA_Remote.OrderControl.InitGridData() +8219
YZA_Remote.OrderControl.btnFetchNewData_Click(Object sender,
EventArgs e) +49
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String
eventArgument) +57
System.Web.UI.Page. RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1273
Walter Wang [MSFT] wrote:
> Hi,
> Would you please post the detailed exception when the page times out? Try
> to visit it on localhost so that you can see the detailed exception.
> I think this might not be related to the sql query's time out settings.
> Anyway, let's see the exception first.
> Sincerely,
> Walter Wang (wawang@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> [url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif[/ur
l]
> ications. If you are using Outlook Express, please make sure you clear the
> check box "Tools/Options/Read: Get 300 headers at a time" to see your repl
y
> promptly.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscript...t/default.aspx.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights.[/color
]
Hi,
Hope you're better now.
For page execution time out setting, it's only effective in Release mode:
#httpRuntime Element (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/library/e1f13641.aspx
executionTimeout Optional TimeSpan attribute.
Specifies the maximum number of seconds that a request is allowed to
execute before being automatically shut down by ASP.NET.
This time-out applies only if the debug attribute in the compilation
element is False. To help to prevent shutting down the application while
you are debugging, do not set this time-out to a large value.
The default is "00:01:50" (110 seconds).Note
In the .NET Framework 1.0 and 1.1, the default is 90.
#############
From the exception and stack trace, it seems related to ADO.NET query timed
out. To confirm this issue is not related to ASP.NET, try to issue the
query in a WinForm or Console application. Normally you only need to set
the connection time out in the connection string and you set the command
time out in CommandTimeOut property. This should work as expected. Anyway,
let's first narrow down the issue to see if it's related to ASP.NET or not.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks 4 the response. Can I run the query in "Query analyzer?"
Walter Wang [MSFT] wrote:
> Hi,
> Hope you're better now.
> For page execution time out setting, it's only effective in Release mode:
> #httpRuntime Element (ASP.NET Settings Schema)
> http://msdn2.microsoft.com/en-us/library/e1f13641.aspx
> executionTimeout Optional TimeSpan attribute.
> Specifies the maximum number of seconds that a request is allowed to
> execute before being automatically shut down by ASP.NET.
> This time-out applies only if the debug attribute in the compilation
> element is False. To help to prevent shutting down the application while
> you are debugging, do not set this time-out to a large value.
> The default is "00:01:50" (110 seconds).Note
> In the .NET Framework 1.0 and 1.1, the default is 90.
> #############
>
> From the exception and stack trace, it seems related to ADO.NET query time
d
> out. To confirm this issue is not related to ASP.NET, try to issue the
> query in a WinForm or Console application. Normally you only need to set
> the connection time out in the connection string and you set the command
> time out in CommandTimeOut property. This should work as expected. Anyway,
> let's first narrow down the issue to see if it's related to ASP.NET or not
.
>
> Regards,
> Walter Wang (wawang@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights.[/color
]
I suggest create a simple Console application and use the same database
access code in your web application to test it, this way we could know if
it's related to ASP.NET or not.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] wrote:
> I suggest create a simple Console application and use the same database
> access code in your web application to test it, this way we could know if
> it's related to ASP.NET or not.
>
> Regards,
> Walter Wang (wawang@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights.[/color
]
Walter Sorry for the delayed response again. I am going to have to hold
off on this for a little while. I am not a programmer I just have a
little light programming experience with VB based languages. The
program was initially created by an experienced coder and due to $ my
company doesnt want to hire him again to fix this problem so this is
why I am stuck with it. The query comes from a complex stored
proceedure that is like 10 pages long! It will take me some time to
build a Console app. so I will have to hold off on this when I am not
so busy. Thanks for your time.

Set ASPNET Version for Virtual Directory from C# App

I am writing a C# Windows Application that will create virtual directories o
n
our Win 2003 server machines. Using the System.DirectoryServices
DirectoryEntry class I have had very little trouble remotely creating and
configuring virtual directories on our servers. My problem is that I have
not found a way to remotely configure the version of ASPNET that will be use
d
by the application running in the virtual directories I create. We have a
mix of Web applications that require either version 1.1 or 2.0. The only wa
y
that I have found to manipulate ASPNET setting, other than doing it manually
through IIS Manager, is with the ASPNET_regiis.exe tool, which must be run o
n
the machine that is serving the virtual directory. Is there any way to set
a
virtual directory's ASPNET version remotely?
Mikere:
!> The only way that I have found to manipulate ASP.NET setting, other than
doing it
!> manually through IIS Manager, is with the ASPNET_regiis.exe tool, which m
ust be
!> run on the machine that is serving the virtual directory.
Right...
re:
!> Is there any way to set a virtual directory's ASP.NET version remotely?
Not that I know of.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"mikes" <mikes@.discussions.microsoft.com> wrote in message news:8F4530DF-4CAA-4A93-A19E-53B
AECAF5432@.microsoft.com...
>I am writing a C# Windows Application that will create virtual directories
on
> our Win 2003 server machines. Using the System.DirectoryServices
> DirectoryEntry class I have had very little trouble remotely creating and
> configuring virtual directories on our servers. My problem is that I have
> not found a way to remotely configure the version of ASPNET that will be u
sed
> by the application running in the virtual directories I create. We have a
> mix of Web applications that require either version 1.1 or 2.0. The only
way
> that I have found to manipulate ASPNET setting, other than doing it manual
ly
> through IIS Manager, is with the ASPNET_regiis.exe tool, which must be run
on
> the machine that is serving the virtual directory. Is there any way to se
t a
> virtual directory's ASPNET version remotely?
> Mike

Set ASPNET Version for Virtual Directory from C# App

I am writing a C# Windows Application that will create virtual directories on
our Win 2003 server machines. Using the System.DirectoryServices
DirectoryEntry class I have had very little trouble remotely creating and
configuring virtual directories on our servers. My problem is that I have
not found a way to remotely configure the version of ASPNET that will be used
by the application running in the virtual directories I create. We have a
mix of Web applications that require either version 1.1 or 2.0. The only way
that I have found to manipulate ASPNET setting, other than doing it manually
through IIS Manager, is with the ASPNET_regiis.exe tool, which must be run on
the machine that is serving the virtual directory. Is there any way to set a
virtual directory's ASPNET version remotely?

Mikere:
!The only way that I have found to manipulate ASP.NET setting, other than doing it
!manually through IIS Manager, is with the ASPNET_regiis.exe tool, which must be
!run on the machine that is serving the virtual directory.

Right...

re:
!Is there any way to set a virtual directory's ASP.NET version remotely?

Not that I know of.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"mikes" <mikes@.discussions.microsoft.comwrote in message news:8F4530DF-4CAA-4A93-A19E-53BAECAF5432@.microsoft.com...

Quote:

Originally Posted by

>I am writing a C# Windows Application that will create virtual directories on
our Win 2003 server machines. Using the System.DirectoryServices
DirectoryEntry class I have had very little trouble remotely creating and
configuring virtual directories on our servers. My problem is that I have
not found a way to remotely configure the version of ASPNET that will be used
by the application running in the virtual directories I create. We have a
mix of Web applications that require either version 1.1 or 2.0. The only way
that I have found to manipulate ASPNET setting, other than doing it manually
through IIS Manager, is with the ASPNET_regiis.exe tool, which must be run on
the machine that is serving the virtual directory. Is there any way to set a
virtual directory's ASPNET version remotely?
>
Mike

Thursday, March 29, 2012

Set connection string of table adapter dynamically

Hello .
I am stucked with the following problem and hope you can help me :
- My ASP.NET 2.0 application has one master database .
- This master database has a Databases table with list of children
databases .
- All children databases have the same schema ( only the data is
different ) .
My application connects to the Master database first (
connection String of this database should be read from the C:\WINDOWS
\XXX.INI file).
Login web page will present drop-down list of sub-databases ( which
will be
retrieved from the Master database ) and then will connect to
specified sub-database and will display data
from this database in a GridView .
I would like to be able to bind this GridView to the Data Source
Objects , to edit all columns during design time , and to set the
connection string of corresponding table adapter programmatically
during run-time .
How can I do this ?
I found several references to the connection string ( for example ,
via appSettings) , but I got an error message that this is read only
parameter .
Please advice .
Thanks in advance for your help ,
Orit Chanukov .Keep it in a session variable.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Orit" <oritc123@.gmail.com> wrote in message
news:1183138531.120152.59480@.a26g2000pre.googlegroups.com...
> Hello .
> I am stucked with the following problem and hope you can help me :
> - My ASP.NET 2.0 application has one master database .
> - This master database has a Databases table with list of children
> databases .
> - All children databases have the same schema ( only the data is
> different ) .
> My application connects to the Master database first (
> connection String of this database should be read from the C:\WINDOWS
> \XXX.INI file).
> Login web page will present drop-down list of sub-databases ( which
> will be
> retrieved from the Master database ) and then will connect to
> specified sub-database and will display data
> from this database in a GridView .
> I would like to be able to bind this GridView to the Data Source
> Objects , to edit all columns during design time , and to set the
> connection string of corresponding table adapter programmatically
> during run-time .
> How can I do this ?
> I found several references to the connection string ( for example ,
> via appSettings) , but I got an error message that this is read only
> parameter .
> Please advice .
> Thanks in advance for your help ,
> Orit Chanukov .
>

Set connection string of table adapter dynamically

Hello .

I am stucked with the following problem and hope you can help me :

-My ASP.NET 2.0 application has one master database .
-This master database has a Databases table with list of children
databases .
-All children databases have the same schema ( only the data is
different ) .
My application connects to the Master database first (
connection String of this database should be read from the C:\WINDOWS
\XXX.INI file).
Login web page will present drop-down list of sub-databases ( which
will be
retrieved from the Master database ) and then will connect to
specified sub-database and will display data
from this database in a GridView .
I would like to be able to bind this GridView to the Data Source
Objects , to edit all columns during design time , and to set the
connection string of corresponding table adapter programmatically
during run-time .
How can I do this ?
I found several references to the connection string ( for example ,
via appSettings) , but I got an error message that this is read only
parameter .
Please advice .
Thanks in advance for your help ,
Orit Chanukov .Keep it in a session variable.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Orit" <oritc123@.gmail.comwrote in message
news:1183138531.120152.59480@.a26g2000pre.googlegro ups.com...

Quote:

Originally Posted by

Hello .
>
I am stucked with the following problem and hope you can help me :
>
- My ASP.NET 2.0 application has one master database .
- This master database has a Databases table with list of children
databases .
- All children databases have the same schema ( only the data is
different ) .
My application connects to the Master database first (
connection String of this database should be read from the C:\WINDOWS
\XXX.INI file).
Login web page will present drop-down list of sub-databases ( which
will be
retrieved from the Master database ) and then will connect to
specified sub-database and will display data
from this database in a GridView .
I would like to be able to bind this GridView to the Data Source
Objects , to edit all columns during design time , and to set the
connection string of corresponding table adapter programmatically
during run-time .
How can I do this ?
I found several references to the connection string ( for example ,
via appSettings) , but I got an error message that this is read only
parameter .
Please advice .
Thanks in advance for your help ,
Orit Chanukov .
>

Set culture for a DLL (class library) referenced from web application

I am developing a DLL (class library) for a web application of mine.

In the web.config of the web application I have set: culture="en-GB"
uiCulture="en" in order that the date format will be dd/mm/yyyy.

I also changed the regional settings to that date format.

When I am using the Now() function in the DLL I get the date format in
mm/dd/yyyy instead. Why the date format in the DLL is different? Shouldn't
it take the culture settings from the web application he is referenced from?

How can I control the date format of the DLL (class library)?

Thanks for your time

ra294@dotnet.itags.org.hotmail.comYa Ya,

See this article on settig culture.

http://www.dotnetjunkies.com/Tutori...33D2EDD38B.dcik

I don't believe you are setting the culture on the thread and the
application assumes the culture of the server.

HTH MikeL.

"Ya Ya" wrote:

> I am developing a DLL (class library) for a web application of mine.
> In the web.config of the web application I have set: culture="en-GB"
> uiCulture="en" in order that the date format will be dd/mm/yyyy.
> I also changed the regional settings to that date format.
> When I am using the Now() function in the DLL I get the date format in
> mm/dd/yyyy instead. Why the date format in the DLL is different? Shouldn't
> it take the culture settings from the web application he is referenced from?
> How can I control the date format of the DLL (class library)?
>
> Thanks for your time
> ra294@.hotmail.com
>

Set Culture

I would like to set the culture for my application to English.
I should change machine.config
How, does anybody know?
Thank you,
SimonHi..
You can configure application specific culture in web.config too..below
sample could help you. Also you can make a certain page culture specific by
adding
<%@. Page language="c#" Culture="en-US"%> on page directive..
For web.config file add <globalization>
<configuration>
<system.web>
<globalization
requestencoding="utf-8"
responseencoding=" utf-8"
fileencoding=" utf-8"
culture="en-US"
uiculture="en" />
</system.web>
</configuration>
HTH
With Best Regards
Naveen K S
"simon" wrote:

> I would like to set the culture for my application to English.
> I should change machine.config
> How, does anybody know?
> Thank you,
> Simon
>
>

Set Culture

I would like to set the culture for my application to English.
I should change machine.config

How, does anybody know?

Thank you,
SimonHi..

You can configure application specific culture in web.config too..below
sample could help you. Also you can make a certain page culture specific by
adding
<%@. Page language="c#" Culture="en-US"%> on page directive..

For web.config file add <globalization>
<configuration>
<system.web>
<globalization
requestencoding="utf-8"
responseencoding=" utf-8"
fileencoding=" utf-8"
culture="en-US"
uiculture="en" />
</system.web>
</configuration
HTH

With Best Regards
Naveen K S

"simon" wrote:

> I would like to set the culture for my application to English.
> I should change machine.config
> How, does anybody know?
> Thank you,
> Simon
>

Set Custom Page properties declaratively

Hi,
I have a base class (which inherits from System.Web.UI.Page) for all the
pages in my application. I have a property defined on this class that I wan
t
to set declaratively in the .aspx (i.e., not in the .aspx.cs) file.
Is there any way to do this declaratively? When I try to use the <@dotnet.itags.org. Page
...> directive, it only allows the predefined attributes to be used.
Thanks,
Richard Brown<script language="CSharp" runat="server">
// put your code in here
</script>
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a horse to water,
but you can't make him think.
"Richard Brown" <Richard Brown@.discussions.microsoft.com> wrote in message
news:70E934C5-8E5D-40C8-ACE0-4A1D2D7587E9@.microsoft.com...
> Hi,
> I have a base class (which inherits from System.Web.UI.Page) for all the
> pages in my application. I have a property defined on this class that I
> want
> to set declaratively in the .aspx (i.e., not in the .aspx.cs) file.
> Is there any way to do this declaratively? When I try to use the <@. Page
> ...> directive, it only allows the predefined attributes to be used.
> Thanks,
> Richard Brown
>
Thanks for replying so quickly. Unfortunately the example you have provided
does not meet my requirements on two counts:
1. This is not declarative. This is code, and I would add this to the
code-behind class.
2. The <script> tags allow the client to define functions, but not run code
.
If the code requires to be run it needs the old-style <% %> breakout.
However this code is then run during the rendering of the page, which is
invoked from the .Net Framework (i.e,. the client does not have control over
when this code is executed).
I was wondering if there is a way of declaratively setting the properties of
the page class before the OnInit (in much the same way that properties are
set in a server control).
Thanks,
Richard Brown
"Kevin Spencer" wrote:

> <script language="CSharp" runat="server">
> // put your code in here
> </script>
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> You can lead a horse to water,
> but you can't make him think.
> "Richard Brown" <Richard Brown@.discussions.microsoft.com> wrote in message
> news:70E934C5-8E5D-40C8-ACE0-4A1D2D7587E9@.microsoft.com...
>
>

SET DATEFIRST and ASP.NET

Hi Everyone,

My scenario is that I am writing and application on a server which host
several ASP.NET applications. In my application I would like to use a
function which relies on a custom function which unfortunately is dependent
on the SQL Server's SET DATEFIRST command which sets the first day of the
week for the current session.

The ASPNET account is solely responsible for opening and closing SQL
Connections for example, if I want data from a view, I run a function which
opens the connection gets the data and then closes it. If I issue a SET
DATEFIRST in one function and dont in another, will it get the default in
the second because I closed down the connection. >?

--
GoofyActually, while waiting I have done an experiement. The logic holds true.
Once the connection under which the SET DATEFIRST is used is closed, when a
new connection is re-opened, the default is restored so you can use this
independent of anyone else.

"Goofy" <me@.mine.comwrote in message
news:udxrRrJCHHA.204@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hi Everyone,
>
My scenario is that I am writing and application on a server which host
several ASP.NET applications. In my application I would like to use a
function which relies on a custom function which unfortunately is
dependent on the SQL Server's SET DATEFIRST command which sets the first
day of the week for the current session.
>
The ASPNET account is solely responsible for opening and closing SQL
Connections for example, if I want data from a view, I run a function
which opens the connection gets the data and then closes it. If I issue a
SET DATEFIRST in one function and dont in another, will it get the default
in the second because I closed down the connection. >?
>
>
>
>
--
Goofy
>

Wednesday, March 28, 2012

SET DATEFIRST and ASP.NET

Hi Everyone,
My scenario is that I am writing and application on a server which host
several ASP.NET applications. In my application I would like to use a
function which relies on a custom function which unfortunately is dependent
on the SQL Server's SET DATEFIRST command which sets the first day of the
w for the current session.
The ASPNET account is solely responsible for opening and closing SQL
Connections for example, if I want data from a view, I run a function which
opens the connection gets the data and then closes it. If I issue a SET
DATEFIRST in one function and dont in another, will it get the default in
the second because I closed down the connection. >?
GoofyActually, while waiting I have done an experiement. The logic holds true.
Once the connection under which the SET DATEFIRST is used is closed, when a
new connection is re-opened, the default is restored so you can use this
independent of anyone else.
"Goofy" <me@.mine.com> wrote in message
news:udxrRrJCHHA.204@.TK2MSFTNGP04.phx.gbl...
> Hi Everyone,
> My scenario is that I am writing and application on a server which host
> several ASP.NET applications. In my application I would like to use a
> function which relies on a custom function which unfortunately is
> dependent on the SQL Server's SET DATEFIRST command which sets the first
> day of the w for the current session.
> The ASPNET account is solely responsible for opening and closing SQL
> Connections for example, if I want data from a view, I run a function
> which opens the connection gets the data and then closes it. If I issue a
> SET DATEFIRST in one function and dont in another, will it get the default
> in the second because I closed down the connection. >?
>
>
> --
> Goofy
>

Monday, March 26, 2012

set default login name

i want to set the default login name for user, i.e. each time the user use
the application, the login name would be displayed in advance and user only
need to input the password. how to do that'
million thanks..That depends, is this user creating an account.
Does the username exists already.
Is the username the same for all users or different for each user.
I'm assuming that the user has already got an account, and returning to the
site.
The way you can make the site remember a user is with cookies.
You set the cookie when the user logs in. Then whenever the page loads, it
looks of that cookie exists and if so, sets the users username in the
username textbox
"Grey" <erickwyum@.i-cable.com> wrote in message
news:%234sQC77nEHA.2808@.TK2MSFTNGP10.phx.gbl...
>i want to set the default login name for user, i.e. each time the user use
> the application, the login name would be displayed in advance and user
> only
> need to input the password. how to do that'
> million thanks..
>

set default schema on connection string

Hi,
We have a aps.net 2.0 web application and sqlserver 2005.
We keep the connection string in the web.config file.
We need to set the for the web application...
so we do not have to hard code the default schema in every call.
Is it possible to set default schema in the connection string?
Thanks
NalakaHi,
can't you set default schema for the SQL Server user which you use for the
ASP.NET application?
Sample from Books Online
USE AdventureWorks;
ALTER USER Abolrous WITH DEFAULT_SCHEMA = Purchasing;
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Nalaka" <nalaka12@.nospam.nospam> wrote in message
news:uGEIEY5IGHA.2708@.tk2msftngp13.phx.gbl...
> Hi,
> We have a aps.net 2.0 web application and sqlserver 2005.
> We keep the connection string in the web.config file.
> We need to set the for the web application...
> so we do not have to hard code the default schema in every call.
> Is it possible to set default schema in the connection string?
>
> Thanks
> Nalaka
>

set default schema on connection string

Hi,
We have a aps.net 2.0 web application and sqlserver 2005.
We keep the connection string in the web.config file.

We need to set the for the web application...
so we do not have to hard code the default schema in every call.

Is it possible to set default schema in the connection string?

Thanks
NalakaHi,

can't you set default schema for the SQL Server user which you use for the
ASP.NET application?

Sample from Books Online

USE AdventureWorks;
ALTER USER Abolrous WITH DEFAULT_SCHEMA = Purchasing;

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Nalaka" <nalaka12@.nospam.nospam> wrote in message
news:uGEIEY5IGHA.2708@.tk2msftngp13.phx.gbl...
> Hi,
> We have a aps.net 2.0 web application and sqlserver 2005.
> We keep the connection string in the web.config file.
> We need to set the for the web application...
> so we do not have to hard code the default schema in every call.
> Is it possible to set default schema in the connection string?
>
> Thanks
> Nalaka

Set Focus

Hi, i'm working on MS visual.net using C# asp.net web application. Can someone help with the code to set focus on a textbox when the page is load?
I tried many ways including the examples in metabuilders.com but just couldn't do it.
Wat is the code that need to be insert during pageload.

Hope someone will help me with this. Thanks.

RegisterStartupScript("myfocus", "<SCRIPT>document.all." + TextBox1.ClientID + ".focus();</SCRIPT>");

Thanks for your input. But where do i place this code in? is it in the pageload part? Because there is an error message.

Thank you.
what is the error?
pls post code and error.
the same

in vb .net
'write this function in side server code

Private Sub mySetFocus(ByVal ctrl As System.Web.UI.Control)

Dim strFocus As String
strFocus = strFocus + "<SCRIPT language='javascript'>"
strFocus = strFocus + "document.getElementById('" & ctrl.ID & "').focus();"
'if want select
strFocus = strFocus + "if ( document.getElementById('" & ctrl.ID & "').select != null ){document.getElementById('" & ctrl.ID & "').select();}"

strFocus = strFocus + "</SCRIPT>"
RegisterStartupScript("mySetFocus", strFocus)

End Sub

'call whit control for focus
call mySetFocus(txtControl)
Is there any way that we can do this without using javascript?
AFAIK, that's a client side / browser issue,
so Javascript can utimately do this in ASP.NET
hi ChinHan:

If you want set focus to a textbox when the page load,

if so txtbox is a textbox control that if you want , you can do like this

<body onload="javascript:document.all.txtbox.focus();"></body>
Thanks.. rox.scott. manage to solve the problem.. Thanks a lot.

I have another qns.. after i enter the data in the textbox, i have a search button to find the information.. but i can't press the ENTER key to search it. i need to use a mouse click.. how do i solve this.. In windows form there is no problem but in asp.net web application this problem occurs..

Thanks!
Hello,

that is another task where you can use javascript to accomplish this. In my opinion one of the best way to solve this has made Janus Kamp Hansen with his script. I want to show you this in the following example:

Public Sub DefaultButton(ByRef Page As System.Web.UI.Page, ByRef objTextControl As TextBox, ByRef objDefaultButton As Button)

' Sets default buttons.
' Created by Janus Kamp Hansen - http://www.kamp-hansen.dk
Dim sScript As New System.Text.StringBuilder()

sScript.Append("<SCRIPT language=""javascript"">" & vbCrLf)
sScript.Append("function fnTrapKD(btn){" & vbCrLf)
sScript.Append(" if (document.all){" & vbCrLf)
sScript.Append(" if (event.keyCode == 13)" & vbCrLf)
sScript.Append(" { " & vbCrLf)
sScript.Append(" event.returnValue=false;" & vbCrLf)
sScript.Append(" event.cancel = true;" & vbCrLf)
sScript.Append(" btn.click();" & vbCrLf)
sScript.Append(" } " & vbCrLf)
sScript.Append(" } " & vbCrLf)
sScript.Append("}" & vbCrLf)
sScript.Append("</SCRIPT>" & vbCrLf)

objTextControl.Attributes.Add("onkeydown", "fnTrapKD(document.all." & objDefaultButton.ClientID & ")")
Page.RegisterStartupScript("ForceDefaultToScript", sScript.ToString)

End Sub

Put this code in your code-behind module and in the page load event you can define the default buttons for the ENTER-Key like in the following sample:
 DefaultButton(Me.Page, Me.txtField, Me.cmdDefaultButton)
For any explanation please look at the web-address in the code...

HTH,
If you are using ServerSide button control, then if you have your code in buttonX_Click event then on click on that buitton only that event fires.

But, there is an alternative solution for this.

If you enter data in TextBox and press Enter, then again Page_Load event will fires as my understanding.

So what you have to do is

on Page_Load check if the textbox has value or not, if the textbox has value then call your button_click event

Ex:

on page load event

If len(textbox1.text) > 0 Then
Button1_Click(sender,e)
End if

this kind of logic might helps to your problem!
hi kbrocksi SEC.. i'm working on a C# project. Do u have it in C#? thanks!
Hi, I am having the opposite problem...I have multiple textboxes on my page, and I have set focus to the first one...but when the user presses the enter key it fires the btnEdit_Click event...causing all kinds of issues. How do I stop it from running the button click and make it set focus to the next string??

I've tried capturing the keypress event of the form, to simply move it to another control, but that doesn't seem to work either.
here's the code:


frmMain.Attributes.Add("onkeypress", "frmMain_keyPress;")

Dim sbJavaFunction As StringBuilder = Nothing
sbJavaFunction = New StringBuilder

sbJavaFunction.Append("<script language=""javascript"">function frmMain_keyPress()")
sbJavaFunction.Append("{frmmain.lblTest.Text='hi';")
sbJavaFunction.Append("if (event.keyCode == 13){")
'sbJavaFunction.Append("event.cancelBubble = true;")
'sbJavaFunction.Append("event.returnValue = false;")
sbJavaFunction.Append("document.forms[0].txtTotalPairs.Focus;")
'sbJavaFunction.Append("document.forms[0].txtTurn_TextChanged();")
sbJavaFunction.Append("}}</script>")
Page.RegisterClientScriptBlock("HandleEnterKey", sbJavaFunction.ToString())
sbJavaFunction = Nothing

any ideas would be helpful!
Chinhan...here is the translation of the above code:

private void Page_Load(object sender, System.EventArgs e)
{
DefaultButton(this.Page, this.txtField, this.cmdDefaultButton);
}

public void DefaultButton(Page Page, TextBox objTextControl, Button objDefaultButton)
{
// Sets default buttons.
// Created by Janus Kamp Hansen - http://www.kamp-hansen.dk
System.Text.StringBuilder sScript = new System.Text.StringBuilder();

sScript.Append("<SCRIPT language='javascript'>\n");
sScript.Append("function fnTrapKD(btn){\n");
sScript.Append(" if (document.all){\n");
sScript.Append(" if (event.keyCode == 13)\n");
sScript.Append(" { \n");
sScript.Append(" event.returnValue=false;\n");
sScript.Append(" event.cancel = true;\n");
sScript.Append(" btn.click();\n");
sScript.Append(" } \n");
sScript.Append(" } \n");
sScript.Append("}\n");
sScript.Append("</SCRIPT>\n");

objTextControl.Attributes.Add("onkeydown", "fnTrapKD(document.all." + objDefaultButton.ClientID + ")");
Page.RegisterStartupScript("ForceDefaultToScript", sScript.ToString());
}


Daisy, why not use theonblur event