Click here to Skip to main content
15,916,693 members
Home / Discussions / C#
   

C#

 
QuestionHandling with multiple SQL-DataReader Pin
softwarejaeger10-Aug-09 6:45
softwarejaeger10-Aug-09 6:45 
AnswerRe: Handling with multiple SQL-DataReader Pin
Ennis Ray Lynch, Jr.10-Aug-09 6:55
Ennis Ray Lynch, Jr.10-Aug-09 6:55 
GeneralRe: Handling with multiple SQL-DataReader Pin
PIEBALDconsult10-Aug-09 7:03
mvePIEBALDconsult10-Aug-09 7:03 
AnswerRe: Handling with multiple SQL-DataReader Pin
PIEBALDconsult10-Aug-09 6:55
mvePIEBALDconsult10-Aug-09 6:55 
GeneralRe: Handling with multiple SQL-DataReader Pin
softwarejaeger10-Aug-09 7:20
softwarejaeger10-Aug-09 7:20 
GeneralRe: Handling with multiple SQL-DataReader Pin
N a v a n e e t h10-Aug-09 7:50
N a v a n e e t h10-Aug-09 7:50 
GeneralRe: Handling with multiple SQL-DataReader Pin
PIEBALDconsult10-Aug-09 8:20
mvePIEBALDconsult10-Aug-09 8:20 
GeneralRe: Handling with multiple SQL-DataReader Pin
N a v a n e e t h10-Aug-09 8:47
N a v a n e e t h10-Aug-09 8:47 
GeneralRe: Handling with multiple SQL-DataReader Pin
PIEBALDconsult10-Aug-09 9:03
mvePIEBALDconsult10-Aug-09 9:03 
GeneralRe: Handling with multiple SQL-DataReader Pin
N a v a n e e t h10-Aug-09 9:14
N a v a n e e t h10-Aug-09 9:14 
GeneralRe: Handling with multiple SQL-DataReader Pin
PIEBALDconsult10-Aug-09 8:09
mvePIEBALDconsult10-Aug-09 8:09 
GeneralRe: Handling with multiple SQL-DataReader Pin
softwarejaeger10-Aug-09 19:38
softwarejaeger10-Aug-09 19:38 
AnswerRe: Handling with multiple SQL-DataReader Pin
senguptaamlan10-Aug-09 22:54
senguptaamlan10-Aug-09 22:54 
GeneralRe: Handling with multiple SQL-DataReader Pin
softwarejaeger11-Aug-09 2:19
softwarejaeger11-Aug-09 2:19 
QuestionGeneric question Pin
Peter Todd10-Aug-09 5:50
Peter Todd10-Aug-09 5:50 
AnswerRe: Generic question Pin
J4amieC10-Aug-09 6:03
J4amieC10-Aug-09 6:03 
the problem you have is that A does not exist, but A<T> does. So you cant cast to A.

However, seeing as method Xyz() does not rely on Generic type T at all, I would structure your code to include non-generic type A and then inherit for the generic stuff:

public class A 
{
// non-generic implementation ommited

public int Xyz()
{ // details omitted
}
}

public class A<T> : A where T : class
{
  // generic implementation ommited
}


now, this will work:

if (ref is A)
{
int returnValue = ((A)ref).Xyz();
}

GeneralRe: Generic question Pin
Luc Pattyn10-Aug-09 6:14
sitebuilderLuc Pattyn10-Aug-09 6:14 
GeneralRe: Generic question Pin
J4amieC10-Aug-09 6:59
J4amieC10-Aug-09 6:59 
AnswerRe: Generic question Pin
Luc Pattyn10-Aug-09 6:03
sitebuilderLuc Pattyn10-Aug-09 6:03 
AnswerRe: Generic question Pin
PIEBALDconsult10-Aug-09 6:17
mvePIEBALDconsult10-Aug-09 6:17 
GeneralRe: Generic question Pin
Luc Pattyn10-Aug-09 6:22
sitebuilderLuc Pattyn10-Aug-09 6:22 
GeneralRe: Generic question [modified] Pin
PIEBALDconsult10-Aug-09 9:35
mvePIEBALDconsult10-Aug-09 9:35 
AnswerRe: Generic question Pin
DaveyM6910-Aug-09 7:00
professionalDaveyM6910-Aug-09 7:00 
GeneralRe: Generic question Pin
PIEBALDconsult10-Aug-09 12:59
mvePIEBALDconsult10-Aug-09 12:59 
GeneralRe: Generic question Pin
DaveyM6910-Aug-09 21:25
professionalDaveyM6910-Aug-09 21:25 

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.