开发者

ASP.Net Set type from string

This is probably a dumb question, but is it possible to use a type in an expression - kinda like this:

Dim X as string = "label"
Dim y as <x>

that kind of a thing?开发者_JS百科

The basic issue is that I have a bunch of strongly typed reports and I want to build a class that can call them... so, I'll know from the db the name of the report, but I'm not sure how to have the class produce the report.


No, and why would you want to? Even if VB let you write the second line and compile it, it wouldn't know anything about the type of y at compile time, so what difference would it be if you just declare it As Object, then?

Or do you want to create an object instance when name of class at run-time is a string (i.e. Dim y As Object = New <x>())?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜