Question : objectdatasource error typename cannot be found

I have a dropdown list that I'm binding to an objectdatasource within a edit template of a gridview.  Everything works perfectly fine on our staging server, but when I view on our production server I get the following error:

"The type specified in the TypeName property of the ObjectDataSource 'ObjectDataSource2' could not be found."

The typename is correct.  It works on our staging server.  What would cause this to not work on our production server?  Any way to re-write the code to get this to work?

See the code below.

Thanks.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
<asp:HyperLink runat="server" ID="lnkAddJob" Text="Add New ADP Job Listing" NavigateUrl="~/ADPJobListingOp.aspx"></asp:HyperLink>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" DataKeyNames="JobID" 
            DataSourceID="ObjectDataSource1" OnRowDataBound="GridView1_RowDataBound">
            <Columns>
                <asp:BoundField DataField="JobTitle" HeaderText="JobTitle" 
                    SortExpression="JobTitle" />
                <asp:TemplateField HeaderText="Category" SortExpression="CategoryID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownList1" runat="server" 
                             DataSourceID="ObjectDataSource2" DataTextField="CategoryName" 
                            DataValueField="CategoryID" SelectedValue='<%# Bind("CategoryID") %>'>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
                            SelectMethod="GetCategories" TypeName="ADPLibrary.BLL.JobCategoriesBLL"></asp:ObjectDataSource>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("CategoryName") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="URL" SortExpression="URL">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("URL") %>' Width="1050px"></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("URL") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="City" HeaderText="City" SortExpression="City">
                    <ControlStyle Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="State" HeaderText="State" SortExpression="State">
                    <ControlStyle Width="20px" />
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                
                <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country">
                    <ControlStyle Width="20px" />
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            </Columns>
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            DeleteMethod="DeleteJob" 
            SelectMethod="GetJobs" TypeName="ADPLibrary.BLL.JobBLL" 
            UpdateMethod="UpdateJob">
            <DeleteParameters>
                <asp:Parameter Name="jobID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="categoryID" Type="Int32" />
                <asp:Parameter Name="jobTitle" Type="String" />
                <asp:Parameter Name="url" Type="String" />
                <asp:Parameter Name="city" Type="String" />
                <asp:Parameter Name="state" Type="String" />
                <asp:Parameter Name="country" Type="String" />
                <asp:Parameter Name="jobID" Type="Int32" />
            </UpdateParameters>
        </asp:ObjectDataSource>


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;
using ADPLibrary.DAL;
using ADPLibrary.BLL;

public partial class Controls_ADPJobListingManager : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton lb = (LinkButton)e.Row.Cells[6].Controls[2];

            if (lb.Text.ToLower() == "delete")
            {

                ADP.JobsRow job = (ADP.JobsRow)((DataRowView)e.Row.DataItem).Row;

                lb.OnClientClick = string.Format("return confirm('Are you certain you want to delete {0} job listing?');", job.JobTitle.Replace("'", @"\'"));
            }
        }
    }
}

Answer : objectdatasource error typename cannot be found

Random Solutions  
 
programming4us programming4us