Instantiate TableAdapter at Runtime
- From: Mark Olbert <ChairmanMAO@xxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Jan 2006 15:07:36 -0800
I have a TableAdapter declared in my website's App_Code directory (I'm using the declarative approach to design it).
If, in a web page from the site, I try to instantiate an instance of the TableAdapter dynamically:
protected void Page_Load(object sender, EventArgs e)
{
// check that we can find the Type of the TableAdapter
Type junk = typeof(page_infoTableAdapters.bd_contentTableAdapter);
// now try to create the Type
junk = Type.GetType("page_infoTableAdapters.bd_contentTableAdapter");
//!!!!! junk is null !!!!!!!!!!
// construction logic left out of example
I can't create the Type.
I've run into this before, and it normally means I need to fully-qualify the Type name with the name of the defining assembly. Only
the defining Assembly in this case is dynamically-created by Visual Studio...so what do I do?
- Mark
.
- Follow-Ups:
- Re: Instantiate TableAdapter at Runtime
- From: Mark Olbert
- Re: Instantiate TableAdapter at Runtime
- Prev by Date: Re: App.Config file
- Next by Date: Re: App.Config file
- Previous by thread: App.Config file
- Next by thread: Re: Instantiate TableAdapter at Runtime
- Index(es):
Relevant Pages
|