Last post Jan 02, 2006 02:52 PM by diamondz
Dec 28, 2005 06:22 PM|brobinsondk|LINK
I am probably doing something stupid but I am getting the following error when I am using a custom built (by me) SqlDataProvider.
Value cannot be null. Parameter name: type
I am developing the module in C#. (Why are all the tutorials etc in VB??).
I have traced the problem down to the code at the bottom here (labeled Reflection) in the Reflection module
I am getting a FILENOTFOUNDEXCEPTION at the line shown (with red comment from me)which means that the objType is NOTHING which therefore causes the problem in
I believe it is something to do with the way I have setup my project (SqlDataProvider).
And now to reveal my inexperience with asp.net -
I have created the SqlDataProvider as a project in VS2003 as a class library. What I see then is that I get bin and obj directories created under the project - But I believed that all binaries were supposed to be placed in the dotnetnuke/bin folder - Is
this where I am going wrong.
If so - can you point me the right way to create the project or do I have to dopy the SqlDataProvider.dll manually to dotnetnuke/bin.
many thanks in advance for any help.
Function CreateObject(ByVal TypeName
CacheKey = TypeName
objType = Type.GetType(TypeName,
Dec 29, 2005 09:52 AM|mvermef|LINK
when I create a project in C# for dnn modules I make sure I have DNN and Build Project as part of the Project Solution. Then I add my project items as a reference to Build Project, meaning it will do all of the dll moving for you on build.
They did this so we don't have to do the copy 2-step. I used to use the folder structure that
Bo Norgaard uses. But since the recent releases of DNN 3x, I switched took alittle getting used to as well
Dec 29, 2005 11:16 AM|diamondz|LINK
Dec 30, 2005 08:39 PM|brobinsondk|LINK
thanks for the reply. I hace tracked down the error in the dataprovider class where it instantiates the instance of SqlDataProvider (via reflection)
I believe (probably due to my being a newbie in this area) that there is a bug in the Reflection package.
It seems you specify in all 4 of the method variants at least a namespace and an assembly name.
My assembly was robinsonIT.Kids.SqlProvider for the SqlDataprovider but my namespace was RobinsonIT.Kids. It seems the only way I could get this to work was by specifying the Assembly name in the call in the dataprovider Instance Method to be robinsonIT.Kids.
This seems wrong to me as the method seems to be asking for the assembly name of the SqlDataprovider it is to instantiate - but having single stepped through the code I see it always appends the SqlDataProvider Type (Class) name to the assembly package name
supplied in the call. This seems really odd to me.
But as I said I am reluctant to raise a defect due to my being a newbie..
Thansk for the time you have taken to answer my problem.
Dec 30, 2005 08:42 PM|brobinsondk|LINK
many thanks for you reply. I have put in a reply to the other reply. Any comments you have on my comments woudl without doubt furtehr help my understanding of this area and the conventions in use.
many thanks for your time
Dec 31, 2005 06:12 AM|diamondz|LINK
Jan 02, 2006 08:12 AM|brobinsondk|LINK
many thanks for a great full answer. It has helped.
So if I understand correctly now. If, for instance, I create an Oracle data Provider and call it OracleDataProvider - then this would have to go into another assembly called
robinsonIT.Kids.OracleDataprovider.dll. Is that correct?
I am just getting to grips with the templates and can now see that I should start again with my project. All the pleasure of learning a new area :=))
My code is now working fine. many thanks again for your time.
Jan 02, 2006 02:52 PM|diamondz|LINK