Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Revisiting the global connection object
Message
De
30/04/2007 11:42:53
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/04/2007 09:46:40
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01220816
Message ID:
01221149
Vues:
17
>>You could keep a static array of a type. The type itself could have 2 properties (connection and inUse flag). Instead of strictly checking for item 48 when 47 used you could then check any with inUse flag false. Or if you want to work orderly you could use Queue/Stack classes. ie:(pseudo code)
>
>Thanks
>
>If I would like to use the inUse approach, how would I go about that?

Queue is better, anyway:
public static MyConnection[100] connections;
// init connections

if (!MyConnection[nIndex].IsInUse) { OleDbConnection con = MyConnection[nIndex].Connection; ... }

public class MyConnection
{
 OleDbConnection con;
 Bool isInUse;

 public MyConnection(OleDbConnection con)
 {
   this.con = con;
 }
 public bool IsInUse {get {return this.isInUse;} set {this.isInUse = value;}}
 public OleDbConnection Connection { get {return this.con;} }
}
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform