Click here to Skip to main content
15,889,462 members
Home / Discussions / C#
   

C#

 
QuestionHow to top Visual Studio 2005 Designer from modifying my custom control! Pin
Matthew Klein10-Mar-10 5:28
Matthew Klein10-Mar-10 5:28 
AnswerRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
The Man from U.N.C.L.E.10-Mar-10 5:52
The Man from U.N.C.L.E.10-Mar-10 5:52 
GeneralRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
Matthew Klein10-Mar-10 6:12
Matthew Klein10-Mar-10 6:12 
GeneralRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
Saksida Bojan10-Mar-10 7:31
Saksida Bojan10-Mar-10 7:31 
AnswerRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
DaveyM6910-Mar-10 6:22
professionalDaveyM6910-Mar-10 6:22 
AnswerRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
Matthew Klein10-Mar-10 6:59
Matthew Klein10-Mar-10 6:59 
QuestionChroma key Pin
AlexB4710-Mar-10 4:56
AlexB4710-Mar-10 4:56 
QuestionAnyway to check if a SqlConnection has a SqlTransaction open against it Pin
dlarkin7710-Mar-10 4:21
dlarkin7710-Mar-10 4:21 
Hi,

Is there any way to find out if a SqlConnection has an open SqlTransaction?

Basically I have an object with a method that accepts a SqlConnection as a parameter. This method is called from a number of different application. Sometimes the SqlConnection has a SqlTransaction and other times it doesn't.

So what I need to be able to do is something along the lines of

public bool Post(SqlConnection cn, int ID)
{
  SqlTransaction trans;

  if(cn.HasTransaction)
  {
    trans = cn.Transaction;
  }
  else
  {
    trans = cn.BeginTransaction();
  }

  // some other stuff

  return true;
}


Is there anyway to get something similar?

Thanks,

David
AnswerRe: Anyway to check if a SqlConnection has a SqlTransaction open against it Pin
Pete O'Hanlon10-Mar-10 6:00
mvePete O'Hanlon10-Mar-10 6:00 
GeneralRe: Anyway to check if a SqlConnection has a SqlTransaction open against it Pin
dlarkin7710-Mar-10 6:13
dlarkin7710-Mar-10 6:13 
AnswerRe: Anyway to check if a SqlConnection has a SqlTransaction open against it Pin
PIEBALDconsult10-Mar-10 6:07
mvePIEBALDconsult10-Mar-10 6:07 
GeneralRe: Anyway to check if a SqlConnection has a SqlTransaction open against it Pin
dlarkin7710-Mar-10 6:15
dlarkin7710-Mar-10 6:15 
Questionasp.net c# webcam Pin
brsecu10-Mar-10 4:02
brsecu10-Mar-10 4:02 
AnswerRe: asp.net c# webcam Pin
Chetan Ranpariya11-Mar-10 2:08
Chetan Ranpariya11-Mar-10 2:08 
QuestionFacebook offline access key Pin
rnvrnv10-Mar-10 3:39
rnvrnv10-Mar-10 3:39 
AnswerRe: Facebook offline access key Pin
1.21 Gigawatts10-Mar-10 3:55
1.21 Gigawatts10-Mar-10 3:55 
AnswerRe: Facebook offline access key Pin
Etienne_12315-Jul-10 23:58
Etienne_12315-Jul-10 23:58 
QuestionDetect a line in an image then delete it Pin
snouto10-Mar-10 2:42
snouto10-Mar-10 2:42 
AnswerRe: Detect a line in an image then delete it Pin
#realJSOP10-Mar-10 3:51
mve#realJSOP10-Mar-10 3:51 
QuestionDocumentation Pin
stancrm10-Mar-10 2:38
stancrm10-Mar-10 2:38 
AnswerRe: Documentation Pin
Keith Barrow10-Mar-10 2:41
professionalKeith Barrow10-Mar-10 2:41 
AnswerRe: Documentation Pin
Pete O'Hanlon10-Mar-10 2:44
mvePete O'Hanlon10-Mar-10 2:44 
GeneralMessage Closed Pin
10-Mar-10 2:55
stancrm10-Mar-10 2:55 
GeneralRe: Documentation Pin
Pete O'Hanlon10-Mar-10 3:03
mvePete O'Hanlon10-Mar-10 3:03 
GeneralRe: Documentation Pin
R. Giskard Reventlov10-Mar-10 3:16
R. Giskard Reventlov10-Mar-10 3:16 

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.