Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

How create object with Generic Parameter in C#

$
0
0

Hi Dear

i Have class library with vb.net & I wrote usercontrol my form class is generic type like this

Public Class FrmLookUp(Of T)

Main project in C#. I need to create object and pass data :

   var t = from x in mdc.PatientViews select x;
   FrmLookUp<PatientView> frm = new FrmLookUp<PatientView>(ref t);

but I give error : "Som invalid argument".

I have to write my code in C#. i test this code in vb.net is work correctly.

  Dim frm As New FrmLookUp(Of PersonView)(ctx.PersonViews)


Kohan Co (SoftWare Network Hardware)



Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>