AidenA
asked on
ASP website: The type specified in the TypeName property of ObjectDataSource ObjectDataSource1 could not be found
Hi,
I'm trying to figure out a question for a microsoft exam... where you have a gridview and an objectdatasource like so
So, I created a class called DAL in the codebehind and stuck in a GetData method, but it doesn't work with the error shown in the title of this question. If I move the GetData to the main class of the webform, it still doesn't work with the same error. However, I can get it to work if I set the TypeName in the codebehind (load method) using the following code which I came across on google when trying to solve this
So, that's fine, I can get it to work that way. But, I want to know how to get it to work when the GetData method is in my DAL class... what is the TypeName that I need to specify?
Thanks, Aiden
I'm trying to figure out a question for a microsoft exam... where you have a gridview and an objectdatasource like so
<asp:ObjectDataSource ID="Products" runat="server" SelectMethod="GetData" TypeName="DAL" /> </asp:ObjectDataSource>
So, I created a class called DAL in the codebehind and stuck in a GetData method, but it doesn't work with the error shown in the title of this question. If I move the GetData to the main class of the webform, it still doesn't work with the same error. However, I can get it to work if I set the TypeName in the codebehind (load method) using the following code which I came across on google when trying to solve this
Products.TypeName = Me.GetType().AssemblyQualifiedName
So, that's fine, I can get it to work that way. But, I want to know how to get it to work when the GetData method is in my DAL class... what is the TypeName that I need to specify?
Thanks, Aiden
ASKER
humm, ok, could be a little tricky as my project name has a . in the middle. I tried to put in
TypeName="70562 on 3.5.DAL"
where I set up '70562 on 3.5' as the name of the project. So, still didn't work not surprisingly. There's no namespace in the aspx page. The page is called 'CTC8.aspx'. So, with that info can you tell me what I should set the TypeName to exactly to get this to work?
TypeName="70562 on 3.5.DAL"
where I set up '70562 on 3.5' as the name of the project. So, still didn't work not surprisingly. There's no namespace in the aspx page. The page is called 'CTC8.aspx'. So, with that info can you tell me what I should set the TypeName to exactly to get this to work?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes you can try that. Try this. Create a variable of this type in code behind and then hover your mouse hover it. What do you see in tooltip?
ASKER
well i just typed 'Dim D As New DAL' if that's what you mean, but the tooltip will just say 'D {DAL}' then, so not sure what you mean exactly? If you open up the + part of the tooltip to see all the properties there's probably 50 pieces of information from UICulture to whether it is visible or not to choose from. What are you interested in exactly?
ASKER
anymore on that?
I was just trying to find out the full type of the DAL class. You have to play with this string mate using projectname.namespace.dal or projectname.dal or dal etc.
ASKER
played around with the string before but didn't get it to work. however, I did just give up on that and stick it into the app_code folder with the namespace DALClass so that the below worked ok.
thanks, Aiden
<asp:ObjectDataSource ID="Products" runat="server" SelectMethod="GetData" TypeName="DALClass.DAL"></asp:ObjectDataSource>
thanks, Aiden
ASKER
x
TypeName="DAL"
The format would be projectname.namespace.clas
Example: MyProject.DAL.ProductDAL