Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: Reporting of operating system Pin
michaelvdnest12-Sep-08 4:38
michaelvdnest12-Sep-08 4:38 
AnswerRe: Reporting of operating system Pin
michaelvdnest12-Sep-08 4:39
michaelvdnest12-Sep-08 4:39 
QuestionUser PC and Server on WAN Pin
balu1234512-Sep-08 4:05
balu1234512-Sep-08 4:05 
AnswerRe: User PC and Server on WAN Pin
Manas Bhardwaj12-Sep-08 4:09
professionalManas Bhardwaj12-Sep-08 4:09 
GeneralRe: User PC and Server on WAN Pin
Paul Conrad12-Sep-08 5:38
professionalPaul Conrad12-Sep-08 5:38 
GeneralRe: User PC and Server on WAN Pin
balu1234515-Sep-08 19:16
balu1234515-Sep-08 19:16 
QuestionData binding to fill data grid view Pin
postonoh12-Sep-08 3:47
postonoh12-Sep-08 3:47 
QuestionSqlConnection open despite no service Pin
franz.pilgerstorfer12-Sep-08 2:02
franz.pilgerstorfer12-Sep-08 2:02 
Hi!

I am working on a desktop application in C#. I'd like to show a small icon whether the user has still access to the database or not. Therefore I try to open a connection periodically (timer tick event every 10 sec). When I tested this application something strange happened

1) sql service not running -> I started application -> con.open fails -> catch block -> show disconnect icon
2) i started sql service -> con.open works -> show connect icon
3) i stopped sql service -> con.open STILL works??? -> no exception????

Below you can see my code.

Thread t = new Thread(delegate()
            {
                SqlConnection con = null;

                try
                {
                    string conStr = "CONNECTIONSTRING GOES HERE"; 
                    con = new SqlConnection(conStr);
                    con.Open();
                    datenbankStatus(true); // raise event - show connect icon
                }
                catch (Exception ex)
                {
                    datenbankStatus(false);  // raise event - show disconnect icon
                }
                finally
                {
                    if (con != null && con.State == System.Data.ConnectionState.Open) con.Close();
                }
            });
            t.IsBackground = true;
            t.Start();


Any help would be great!!

Thx in advance
QuestionNeed Help in Image Mapping Pin
tdeepika12-Sep-08 2:00
tdeepika12-Sep-08 2:00 
AnswerRe: Need Help in Image Mapping Pin
Dewald12-Sep-08 2:52
Dewald12-Sep-08 2:52 
GeneralRe: Need Help in Image Mapping Pin
tdeepika14-Sep-08 20:27
tdeepika14-Sep-08 20:27 
QuestionCompile a project from code, or explanations about CodeDom... Pin
kontax12-Sep-08 1:49
kontax12-Sep-08 1:49 
AnswerRe: Compile a project from code, or explanations about CodeDom... Pin
leppie12-Sep-08 2:05
leppie12-Sep-08 2:05 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
kontax12-Sep-08 2:11
kontax12-Sep-08 2:11 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
leppie12-Sep-08 2:17
leppie12-Sep-08 2:17 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
kontax12-Sep-08 2:27
kontax12-Sep-08 2:27 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
leppie12-Sep-08 2:31
leppie12-Sep-08 2:31 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
kontax12-Sep-08 2:33
kontax12-Sep-08 2:33 
AnswerRe: Compile a project from code, or explanations about CodeDom... Pin
Giorgi Dalakishvili12-Sep-08 2:43
mentorGiorgi Dalakishvili12-Sep-08 2:43 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
kontax12-Sep-08 2:52
kontax12-Sep-08 2:52 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
Giorgi Dalakishvili12-Sep-08 3:10
mentorGiorgi Dalakishvili12-Sep-08 3:10 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
kontax12-Sep-08 3:25
kontax12-Sep-08 3:25 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
Giorgi Dalakishvili12-Sep-08 3:37
mentorGiorgi Dalakishvili12-Sep-08 3:37 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
kontax12-Sep-08 3:47
kontax12-Sep-08 3:47 
GeneralRe: Compile a project from code, or explanations about CodeDom... Pin
Giorgi Dalakishvili12-Sep-08 3:53
mentorGiorgi Dalakishvili12-Sep-08 3:53 

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.