Brett Kelly <inkedmn@gmail.com> wrote:[color=blue]
> At this point, I'm just trying to get reflection to work... This is
> what I've got so far:[/color]
<snip>
[color=blue]
> And when I run this, it blows up on the Console.WriteLine call w/
> "Object ref not set to an instance of an object". Now, if I change the
> type name to System.Reflection.Assembly, it works fine. But if I
> change it to System.Data.SqlClient.SqlConnection (for example), that
> doesn't work.[/color]
Yup. That's because System.Reflection.Assembly is in mscorlib, but
SqlConnection isn't. If you don't provide an assembly name in the type
name, only mscorlib and the currently executing assembly are searched.
To find what to use for a particular type, use typeof(...) in a test
program and write out the AssemblyQualifiedName property. For example,
for SqlConnection it's:
System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too