Click here to Skip to main content
15,891,951 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: OCX or USER Control !!!!!!!!!!!!!!!! Pin
Christian Graus30-Apr-09 0:13
protectorChristian Graus30-Apr-09 0:13 
GeneralRe: OCX or USER Control !!!!!!!!!!!!!!!! Pin
Tripathi Swati30-Apr-09 19:10
Tripathi Swati30-Apr-09 19:10 
QuestionIP Addresses List Pin
specialdreamsin29-Apr-09 23:40
specialdreamsin29-Apr-09 23:40 
AnswerRe: IP Addresses List Pin
Rolando CC30-Apr-09 7:12
professionalRolando CC30-Apr-09 7:12 
Questionmulti sql connection to same DB asp.net applcation Pin
Member 616850929-Apr-09 23:30
Member 616850929-Apr-09 23:30 
AnswerRe: multi sql connection to same DB asp.net applcation Pin
SeMartens29-Apr-09 23:37
SeMartens29-Apr-09 23:37 
GeneralRe: multi sql connection to same DB asp.net applcation Pin
Member 616850930-Apr-09 1:34
Member 616850930-Apr-09 1:34 
GeneralRe: multi sql connection to same DB asp.net applcation Pin
Paulo Zemek30-Apr-09 9:30
mvaPaulo Zemek30-Apr-09 9:30 
public static class GlobalConnection
{
public static readonly SqlConnection Value;
static GlobalConnection()
{
Value = new SqlConnection("...");
Value.Open();
}
}

Everywhere you need the connection you call:
GlobalConnection.Value

But this approach will:
1 - Use a single connection for all clients and threads.
2 - Will not reconnect if the connection is lost.

But maybe this works for your needs or as a sample on how to do the job.

Another approach will be:
public static class GlobalConnection
{
private static object _lock = new object();
private static SqlConnection _value;

public static SqlConnection Value
{
get
{
lock (_lock)
{
if (_value == null)
_value = new SqlConnection("...");

switch(_value.State)
{
case ConnectionState.Closed:
case ConnectionState.Broken:
_value.Open();
break;
}
}
}
}
}

This one will reopen the connection if it is closed.
Questionpage loading time is high when not allow paging on gridview [modified] Pin
samerh29-Apr-09 22:42
samerh29-Apr-09 22:42 
AnswerRe: page loading time is high when not allow paging on gridview Pin
Abhijit Jana29-Apr-09 23:05
professionalAbhijit Jana29-Apr-09 23:05 
GeneralRe: page loading time is high when not allow paging on gridview Pin
N a v a n e e t h29-Apr-09 23:15
N a v a n e e t h29-Apr-09 23:15 
GeneralRe: page loading time is high when not allow paging on gridview Pin
samerh29-Apr-09 23:16
samerh29-Apr-09 23:16 
AnswerRe: page loading time is high when not allow paging on gridview Pin
saanj29-Apr-09 23:08
saanj29-Apr-09 23:08 
GeneralRe: page loading time is high when not allow paging on gridview Pin
samerh29-Apr-09 23:19
samerh29-Apr-09 23:19 
AnswerRe: page loading time is high when not allow paging on gridview Pin
N a v a n e e t h29-Apr-09 23:13
N a v a n e e t h29-Apr-09 23:13 
GeneralRe: page loading time is high when not allow paging on gridview Pin
samerh29-Apr-09 23:24
samerh29-Apr-09 23:24 
AnswerRe: page loading time is high when not allow paging on gridview Pin
Andreas X30-Apr-09 1:37
professionalAndreas X30-Apr-09 1:37 
AnswerRe: page loading time is high when not allow paging on gridview Pin
Anurag Gandhi30-Apr-09 2:19
professionalAnurag Gandhi30-Apr-09 2:19 
AnswerRe: page loading time is high when not allow paging on gridview Pin
Paulo Zemek30-Apr-09 12:01
mvaPaulo Zemek30-Apr-09 12:01 
QuestionASCX user control help!! Pin
Armandt__29-Apr-09 22:13
Armandt__29-Apr-09 22:13 
AnswerRe: ASCX user control help!! Pin
dotnetmember29-Apr-09 22:23
dotnetmember29-Apr-09 22:23 
GeneralRe: ASCX user control help!! Pin
Armandt__29-Apr-09 22:34
Armandt__29-Apr-09 22:34 
GeneralRe: ASCX user control help!! Pin
Christian Graus30-Apr-09 0:14
protectorChristian Graus30-Apr-09 0:14 
GeneralRe: ASCX user control help!! Pin
Armandt__30-Apr-09 0:32
Armandt__30-Apr-09 0:32 
QuestionProblem with saving text from HTML editor Pin
janani1329-Apr-09 21:33
janani1329-Apr-09 21:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.