Click here to Skip to main content
16,005,162 members
Home / Discussions / C#
   

C#

 
AnswerRe: Error : 'Proj.frmMain' does not contain a definition for 'Comm1' Pin
Christian Graus10-May-07 15:51
protectorChristian Graus10-May-07 15:51 
Questioninserting textbox values into datagridview Pin
balanjingot10-May-07 15:04
balanjingot10-May-07 15:04 
AnswerRe: inserting textbox values into datagridview Pin
simplicitylabs10-May-07 15:36
simplicitylabs10-May-07 15:36 
GeneralRe: inserting textbox values into datagridview Pin
balanjingot10-May-07 16:53
balanjingot10-May-07 16:53 
Questionvalidation of ASP label [modified] Pin
sreecahitu10-May-07 14:41
sreecahitu10-May-07 14:41 
AnswerRe: validation of ASP label Pin
subrata.jana10-May-07 21:07
subrata.jana10-May-07 21:07 
QuestionRe: validation of ASP label Pin
sreecahitu14-May-07 8:52
sreecahitu14-May-07 8:52 
QuestionUsing A TableAdapter In A Generic Class Pin
fshields10-May-07 11:29
fshields10-May-07 11:29 
I am trying to use a generic class to provide standard data access methods for DataSetS that were created using the wizards. I can't seem to define the TableAdaptor parameter correctly so that the generic recognizes the TableAdaptor Fill() method.

Calling program:
{
GenericIo genericIo =
new GenericIo<
SomeTableAdaptors.SomeTableAdaptor,
SomeDataSet.SomeDataTable>;

SomeTableAdaptors.SomeTableAdaptor tableAdaptor =
new SomeTableAdaptors.SomeTableAdaptor();
SomeDataSet.SomeDataTable dataTable =
new SomeDataSet.SomeDataTable();

genericIo.GetDataTable(tableAdaptor, dataTable);
}

Generic class:
public class GenericIo<t1, t2="">
where T1 : class, new()
where T2 : DataTable, new()
{
public void GetDataTable(T1 tableAdaptor, T2 dataTable)
{
tableAdaptor.Fill(dataTable);
}
}

Compiler error message:
'T1' does not contain a definition for 'Fill'

I have spent many hours trying different things with interfaces, abstract classes, generic constraints, etc. to tell the generic class that T1 does have a Fill method which works on a DataTable, but with no success.

It's either going to be a "no, it can't be done" or the slap-your forehead "Doh". Any guidance will be appreciated.

Thanks,

FShields
AnswerRe: Using A TableAdapter In A Generic Class Pin
fshields10-May-07 19:59
fshields10-May-07 19:59 
QuestionPhysicalMedia instead of LogicalDisk Pin
simplicitylabs10-May-07 10:32
simplicitylabs10-May-07 10:32 
AnswerRe: PhysicalMedia instead of LogicalDisk Pin
Dave Kreskowiak10-May-07 10:40
mveDave Kreskowiak10-May-07 10:40 
GeneralRe: PhysicalMedia instead of LogicalDisk Pin
simplicitylabs10-May-07 10:59
simplicitylabs10-May-07 10:59 
GeneralRe: PhysicalMedia instead of LogicalDisk Pin
Dave Kreskowiak10-May-07 12:41
mveDave Kreskowiak10-May-07 12:41 
GeneralRe: PhysicalMedia instead of LogicalDisk Pin
simplicitylabs10-May-07 14:00
simplicitylabs10-May-07 14:00 
Questionreference c++ dll from c# Pin
donovan.solms10-May-07 10:31
donovan.solms10-May-07 10:31 
AnswerRe: reference c++ dll from c# Pin
donovan.solms10-May-07 12:20
donovan.solms10-May-07 12:20 
GeneralRe: reference c++ dll from c# Pin
donovan.solms10-May-07 12:59
donovan.solms10-May-07 12:59 
GeneralRe: reference c++ dll from c# Pin
Luc Pattyn10-May-07 13:43
sitebuilderLuc Pattyn10-May-07 13:43 
GeneralRe: reference c++ dll from c# Pin
donovan.solms10-May-07 14:06
donovan.solms10-May-07 14:06 
GeneralRe: reference c++ dll from c# Pin
Luc Pattyn10-May-07 15:06
sitebuilderLuc Pattyn10-May-07 15:06 
GeneralRe: reference c++ dll from c# Pin
donovan.solms11-May-07 10:26
donovan.solms11-May-07 10:26 
GeneralRe: reference c++ dll from c# Pin
Luc Pattyn11-May-07 11:01
sitebuilderLuc Pattyn11-May-07 11:01 
GeneralRe: reference c++ dll from c# Pin
donovan.solms11-May-07 11:11
donovan.solms11-May-07 11:11 
QuestionAn algorithm Pin
mehrdadc4810-May-07 10:02
mehrdadc4810-May-07 10:02 
AnswerRe: An algorithm Pin
Giorgi Dalakishvili10-May-07 10:17
mentorGiorgi Dalakishvili10-May-07 10:17 

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.