You need to add the assembly name in for any type that is not in the corrent assembly or mscorlib. So
Type t = Type.GetType("System.Data.DataTable, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
Will work (for version 1.1 of the framework - if you're using 1.0 use the version number for that one)
Btw: System.String is not a Value Type, it a Reference Type
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<#e*************@TK2MSFTNGP11.phx.gbl>
Did you try "typeof(...)" ?
- Sahil Malik
You can reach me thru my blog -
http://www.dotnetjunkies.com/weblog/sahilmalik
"da*******@opco.com" <da*******@opco.com@discussions.microsoft.com> wrote in
message news:81**********************************@microsof t.com...
I am trying to use Type.GetType(name of type in string format) to get an
instance Type. For example: Type t =
Type.GetType("System.Data.DataTable").
I have no trouble to get a value type For example: Type t =
Type.GetType("System.String").
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.770 / Virus Database: 517 - Release Date: 27/09/2004
[microsoft.public.dotnet.languages.csharp]