473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how can i evaluate generic type in runtime in c#

i need to evaluate generic type at runtime using
Expand|Select|Wrap|Line Numbers
  1. Type.GetType()

Expand|Select|Wrap|Line Numbers
  1. Type t  = Type.GetType("className");
  2. Table<t> table = dataContext.GetTable<t>();
  3.  
any ideas ?
Jul 7 '10 #1
1 1429
PsychoCoder
465 Expert Mod 256MB
Not sure what issues you've having. Is your code not working, if not what is it doing versus what you want it to do?
Aug 1 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Cool Guy | last post by:
I don't understand the third paragraph under the heading 'Generic type instantiations' on <http://msdn.microsoft.com/vcsharp/2005/overview/language/generics/>: | The .NET Common Language Runtime...
8
by: Cool Guy | last post by:
From <http://msdn2.microsoft.com/en-us/library/f4a6ta2h(en-US,VS.80).aspx>: | As with the previous use of the Stack<T> class created with the Order | type, another instance of the specialized...
3
by: Joe Adams | last post by:
Hi All, How can I use GetType(<GenericType>).IsAssignableFrom(<MyType>) I need to now if the <MyType> is the same type of class as the <GenericType> without having to add the generic type...
4
by: Charles Churchill | last post by:
I apologize if this question has been asked before, but after about half an hour of searching I haven't been able to find an answer online. My code is beloiw, with comments pertaining to my...
9
by: mps | last post by:
I want to define a class that has a generic parameter that is itself a generic class. For example, if I have a generic IQueue<Tinterface, and class A wants to make use of a generic class that...
1
by: interX | last post by:
Hi I'm new in VC++ and have a question to generics. I have a generic class, which contains an array of the generic type. This array I can pin and then I would like to get an unmanaged pointer to...
9
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
5
by: PJ6 | last post by:
I'd like to be able to declare a function where it always returns the type of the inheritor. To show this in as simple an example that I can think of, where MyClassType is a reflexive generic type...
3
by: webcliff | last post by:
Please help me to look at the following code: -------------start---------- using System; using System.Collections.Generic; public class GenType { }
5
by: Steve K. | last post by:
I know this code is garbage but it should give you an idea of what I'm after: <code> class Test { Type _t = null; public void SetSourceList<T>(Dictionary<string, TsourceList) { _t =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.