Showing posts with label config. Show all posts
Showing posts with label config. Show all posts

Thursday, March 29, 2012

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
>

Monday, March 26, 2012

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

Thursday, March 22, 2012

set masterpage for browser in web.config (.net2.0)

Hi,
it is possible to set the browser dependent masterpage in the web.config,
and how?
in the page attributes it is an easy way, but in the web.config?
In the page-tag it would look like this:
<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" ie:MasterPageFile="~/MasterPage_IE.master"
mozilla:MasterPageFile="~/MasterPage_Firefox.master" %>
Thanks a lot,
Alex<configuration>
<system.Web>
<pages master="default.master" />
</system.Web>
</configuration>
Ashok
"Alexander Widera"
<awid@.hrz.tu-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
message news:OZ4GZEBBGHA.3536@.TK2MSFTNGP11.phx.gbl...
> Hi,
> it is possible to set the browser dependent masterpage in the web.config,
> and how?
> in the page attributes it is an easy way, but in the web.config?
> In the page-tag it would look like this:
> <%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
> Inherits="_Default" ie:MasterPageFile="~/MasterPage_IE.master"
> mozilla:MasterPageFile="~/MasterPage_Firefox.master" %>
>
> Thanks a lot,
> Alex
>
>
this is for the "default" browser...
but how to set special masterpages for different browsers (in the
web.config)?
In the page tag it looks like that (see below)... but in the web.config
...
i dont now how...
<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" ie:MasterPageFile="~/MasterPage_IE.master"
mozilla:MasterPageFile="~/MasterPage_Firefox.master" %>
alex
"Showjumper" <dfgkjhdf> schrieb im Newsbeitrag
news:e3aiMiBBGHA.4092@.TK2MSFTNGP09.phx.gbl...
> <configuration>
> <system.Web>
> <pages master="default.master" />
> </system.Web>
> </configuration>
> Ashok
> "Alexander Widera"
> <awid@.hrz.tu-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
> message news:OZ4GZEBBGHA.3536@.TK2MSFTNGP11.phx.gbl...
web.config,
CodeFile="Default.aspx.cs"
>
>
hasn't anybody a solution?
"Alexander Widera"
<awid@.hrz.tu-chemnitz.de-novaliddomainpleasedeletethispart.de> schrieb im
Newsbeitrag news:%23dQzXgHBGHA.2708@.TK2MSFTNGP12.phx.gbl...
> this is for the "default" browser...
> but how to set special masterpages for different browsers (in the
> web.config)?
> In the page tag it looks like that (see below)... but in the web.config
> ...
> i dont now how...
> <%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
> Inherits="_Default" ie:MasterPageFile="~/MasterPage_IE.master"
> mozilla:MasterPageFile="~/MasterPage_Firefox.master" %>
> alex
>
>
> "Showjumper" <dfgkjhdf> schrieb im Newsbeitrag
> news:e3aiMiBBGHA.4092@.TK2MSFTNGP09.phx.gbl...
> web.config,
> CodeFile="Default.aspx.cs"
>
>

Set MaxLength on form Load

Hi,

Does anyone know how to populate the maxlength property of an asp:textbox on page load?

I'm getting the value from the my config table in my DB

When I try setting myControl.MaxLength=10 in the onload event
It's not written to the control and when I enter text I'm not restricted at all

I've also tried

<asp:textbox id="Abstract" Runat="server" Wrap="True" Rows="11" Columns="45" TextMode="MultiLine" maxlength="<%=SummaryLimit%>"></asp:textbox>

' And

<asp:textbox id="Abstract" Runat="server" Wrap="True" Rows="11" Columns="45" TextMode="MultiLine" maxlength="<%=Convert.ToInt32(SummaryLimit)%>"></asp:textbox>
Geting error - <%=SummaryLimit%> is not a valid value for Int32.
And
<%=Convert.ToInt32(SummaryLimit)%> is not a valid value for Int32.

SummaryLimit Value is declared and assigned as an Int32
Dim m_iSummaryLimit As Int32 = 250

Public Property SummaryLimit() As Int32
Get
Return Convert.ToInt32(m_iSummaryLimit)
End Get
Set(ByVal Value As Int32)
m_iSummaryLimit = Convert.ToInt32(Value)
End Set
End PropertyThe textbox control when in multiline mode actually renders as a HTML textarea therefore on a textarea there is no maxlength property so maxlength does not work. One of the ways to control this is to use javascript instead.
Basilisk,

Thanks for that, just wasted the whole morning trying to get it working.

Cheers Al
I did want to pipe in and say that when you use the following:

<%= ... %>

in an item tag, you need to surround it with single quotes - ' - and not double quotes - " -.
Lord Rat,

Thanks, feel free to pop out of your cave with useful tips like that at anytime :D

Cheers Al

Set Maximum Pool Size in web.config

I would like to allow more connection to SQL servers from the web
application.

Do you know what is the code to set maximum pool size in web.config file?

ThanksA sample connection string for SQL Server:
"Data Source=(local);Initial Catalog=pubs;User ID=sa;Password=;Max Pool Size=75;Min Pool Size=5;"

Tiendq,
tien@.tienonsoftware.com
You can set that in SQL Connection String...e.g

"Server=(local); ........; Database=Northwind; Max Pool Size=45; Min Pool Size=10

When a connection is opened and a pool is created, multiple connections are added to the pool to bring the connection count to the configured minimum level. Connections can be subsequently added to the pool up to the configured maximum pool count. When the maximum count is reached, new requests to open a connection are queued for a configurable duration.

Avneesh Kuma
avneesh@.helloprojects.com
Default value of Max Pool size is 100. You can set it to a higher number also so far as performance of the server is not a issue..

A Detailed article for the same can be found at
http://techrepublic.com.com/5100-6329_11-5034285-2.htm

Regard
Avneesh
Is there any issue if I set the maximum to be 1000?

"Do Quyet Tien" <tien@.tienonsoftware.com> wrote in message
news:47D18900-BF7C-4141-9753-452ED3D57EA0@.microsoft.com...
> A sample connection string for SQL Server:
> "Data Source=(local);Initial Catalog=pubs;User ID=sa;Password=;Max Pool
Size=75;Min Pool Size=5;"
> Tiendq,
> tien@.tienonsoftware.com