Click here to Skip to main content
15,891,704 members
Home / Discussions / C#
   

C#

 
AnswerRe: exception in datagridview Pin
Dave Kreskowiak8-Oct-09 8:54
mveDave Kreskowiak8-Oct-09 8:54 
QuestionMQ Client Error Pin
Jeanie24248-Oct-09 6:58
Jeanie24248-Oct-09 6:58 
AnswerRe: MQ Client Error Pin
harold aptroot8-Oct-09 7:38
harold aptroot8-Oct-09 7:38 
GeneralRe: MQ Client Error Pin
Jeanie24248-Oct-09 9:26
Jeanie24248-Oct-09 9:26 
QuestionProblem with changing connection string that saved in app.config Pin
hdv2128-Oct-09 6:13
hdv2128-Oct-09 6:13 
AnswerRe: Problem with changing connection string that saved in app.config Pin
Md. Marufuzzaman8-Oct-09 6:37
professionalMd. Marufuzzaman8-Oct-09 6:37 
GeneralRe: Problem with changing connection string that saved in app.config Pin
hdv2128-Oct-09 7:25
hdv2128-Oct-09 7:25 
GeneralRe: Problem with changing connection string that saved in app.config Pin
Md. Marufuzzaman8-Oct-09 7:44
professionalMd. Marufuzzaman8-Oct-09 7:44 
Probably you are loading the app.config several times, why dont you use a Hashtable for managing multiple connectionstring
Example:

Hashtable ObjHashtable   = new Hashtable();

ObjHashtable.Add("Key1", "Data Source= source_1 ;Initial Catalog= DatabaseName_1;User ID=id;Password=pwd;");
ObjHashtable.Add("Key2", "Data Source= source_2 ;Initial Catalog= DatabaseName_2;User ID=id;Password=pwd;");

You just need to load the Hashtable only one time...........
  
public SqlDataReader Example(string strSql, string strKey)
{
   ObjSqlConnection = new SqlConnection(ObjHashtable[strKey].ToString());
   ...........
   .......
}

Thanks
Md. Marufuzzaman


Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.

I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

GeneralRe: Problem with changing connection string that saved in app.config Pin
hdv2128-Oct-09 8:03
hdv2128-Oct-09 8:03 
GeneralRe: Problem with changing connection string that saved in app.config Pin
Md. Marufuzzaman8-Oct-09 9:25
professionalMd. Marufuzzaman8-Oct-09 9:25 
GeneralRe: Problem with changing connection string that saved in app.config Pin
hdv2128-Oct-09 10:43
hdv2128-Oct-09 10:43 
AnswerRe: Problem with changing connection string that saved in app.config Pin
cjoki12-Oct-09 5:34
cjoki12-Oct-09 5:34 
Questionnavigator in datagridview Pin
hotthoughtguy8-Oct-09 5:03
hotthoughtguy8-Oct-09 5:03 
AnswerRe: navigator in datagridview Pin
Luc Pattyn8-Oct-09 5:19
sitebuilderLuc Pattyn8-Oct-09 5:19 
Question[Message Deleted] Pin
hotthoughtguy8-Oct-09 4:53
hotthoughtguy8-Oct-09 4:53 
AnswerRe: hi Pin
AndyInUK8-Oct-09 4:56
AndyInUK8-Oct-09 4:56 
QuestionPassing a Form's control to a routine in another class as a variable Pin
yogi_bear_798-Oct-09 4:39
yogi_bear_798-Oct-09 4:39 
AnswerRe: Passing a Form's control to a routine in another class as a variable Pin
Richard MacCutchan8-Oct-09 4:51
mveRichard MacCutchan8-Oct-09 4:51 
GeneralRe: Passing a Form's control to a routine in another class as a variable Pin
yogi_bear_798-Oct-09 4:54
yogi_bear_798-Oct-09 4:54 
AnswerRe: Passing a Form's control to a routine in another class as a variable Pin
Henry Minute8-Oct-09 4:58
Henry Minute8-Oct-09 4:58 
AnswerRe: Passing a Form's control to a routine in another class as a variable Pin
PIEBALDconsult8-Oct-09 5:32
mvePIEBALDconsult8-Oct-09 5:32 
QuestionSuggestions for general networking solution on WAN and LAN Pin
lvq6848-Oct-09 4:24
lvq6848-Oct-09 4:24 
AnswerRe: Suggestions for general networking solution on WAN and LAN Pin
Mirko19808-Oct-09 4:40
Mirko19808-Oct-09 4:40 
Question[C#.NET 2008] Screen-scraping a HTML Page Pin
Dimitri Backaert8-Oct-09 3:47
Dimitri Backaert8-Oct-09 3:47 
AnswerRe: [C#.NET 2008] Screen-scraping a HTML Page Pin
Henry Minute8-Oct-09 4:20
Henry Minute8-Oct-09 4:20 

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.