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

C#

 
QuestionRe: Auto Connect SQLConnection Pin
Midnight Ahri12-Sep-13 3:27
Midnight Ahri12-Sep-13 3:27 
AnswerRe: Auto Connect SQLConnection Pin
Richard MacCutchan12-Sep-13 3:32
mveRichard MacCutchan12-Sep-13 3:32 
AnswerRe: Auto Connect SQLConnection Pin
Midnight Ahri12-Sep-13 5:07
Midnight Ahri12-Sep-13 5:07 
QuestionRe: Auto Connect SQLConnection Pin
Midnight Ahri13-Sep-13 13:57
Midnight Ahri13-Sep-13 13:57 
AnswerRe: Auto Connect SQLConnection Pin
Richard MacCutchan13-Sep-13 22:05
mveRichard MacCutchan13-Sep-13 22:05 
AnswerRe: Auto Connect SQLConnection Pin
Midnight Ahri14-Sep-13 20:12
Midnight Ahri14-Sep-13 20:12 
AnswerRe: Auto Connect SQLConnection Pin
Pete O'Hanlon12-Sep-13 5:18
mvePete O'Hanlon12-Sep-13 5:18 
AnswerRe: Auto Connect SQLConnection Pin
Midnight Ahri12-Sep-13 5:36
Midnight Ahri12-Sep-13 5:36 
Thank you very much, I'm new to task and just found it today.
But I'll keep searching.

After calling OpenAsync, State must return Connecting until the returned Task is completed. Then, if the connection was successful, State must return Open. If the connection fails, State must return Closed.


Sorry that english is not my first language and I'm not that good in programming.
So what I understand above is like this.

C#
this.cnn.OpenASync();

if (this.cnn.State == ConnectionState.Connecting)
{
    //cnn is busy connecting
}

Then if it's busy, then I will return; instead of OpenASync() again.
C#
if (this.cnn.State == ConnectionState.Closed)
{
    //cnn failed to open
}


And if it's closed, then I assume cnn failed and finished processing.

But it's not working.

It's ok, I'll search about task.
Thank you very much btw. Smile | :)
QuestionRe: Auto Connect SQLConnection Pin
Midnight Ahri12-Sep-13 6:45
Midnight Ahri12-Sep-13 6:45 
AnswerRe: Auto Connect SQLConnection Pin
Pete O'Hanlon12-Sep-13 8:13
mvePete O'Hanlon12-Sep-13 8:13 
QuestionRe: Auto Connect SQLConnection Pin
Midnight Ahri12-Sep-13 19:36
Midnight Ahri12-Sep-13 19:36 
QuestionRunning SQL Server 2008 R2 without user interaction Pin
WaseemAmin11-Sep-13 21:49
WaseemAmin11-Sep-13 21:49 
AnswerRe: Running SQL Server 2008 R2 without user interaction Pin
Richard MacCutchan11-Sep-13 22:26
mveRichard MacCutchan11-Sep-13 22:26 
GeneralRe: Running SQL Server 2008 R2 without user interaction Pin
WaseemAmin12-Sep-13 5:54
WaseemAmin12-Sep-13 5:54 
AnswerRe: Running SQL Server 2008 R2 without user interaction Pin
PIEBALDconsult12-Sep-13 3:03
mvePIEBALDconsult12-Sep-13 3:03 
GeneralRe: Running SQL Server 2008 R2 without user interaction Pin
WaseemAmin12-Sep-13 6:02
WaseemAmin12-Sep-13 6:02 
GeneralRe: Running SQL Server 2008 R2 without user interaction Pin
PIEBALDconsult12-Sep-13 14:11
mvePIEBALDconsult12-Sep-13 14:11 
Generalreadonly keyword Pin
N8tiv11-Sep-13 20:38
N8tiv11-Sep-13 20:38 
GeneralRe: readonly keyword Pin
Pete O'Hanlon11-Sep-13 21:05
mvePete O'Hanlon11-Sep-13 21:05 
GeneralRe: readonly keyword Pin
N8tiv11-Sep-13 21:18
N8tiv11-Sep-13 21:18 
GeneralRe: readonly keyword Pin
Pete O'Hanlon11-Sep-13 22:58
mvePete O'Hanlon11-Sep-13 22:58 
GeneralRe: readonly keyword Pin
N8tiv11-Sep-13 23:12
N8tiv11-Sep-13 23:12 
GeneralRe: readonly keyword Pin
Abhinav S12-Sep-13 8:22
Abhinav S12-Sep-13 8:22 
GeneralRe: readonly keyword Pin
DaveyM6913-Sep-13 9:40
professionalDaveyM6913-Sep-13 9:40 
Questiondelay and back again record Pin
eng.iris11-Sep-13 18:07
eng.iris11-Sep-13 18:07 

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.