SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A colleague has developed a SharePoint web-part application (which was developed in VS2005), and deployed on MOSS 2007. We use an .ASCX file for deployment.

This application works fine all day, but something happens overnight whereby we need to do an IISRESET every-morning before it starts working again. (It is basically driving us nuts!)

The error we get is:

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

The relevant 'ObjectDataSource2' in the ascx file has this code:

<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByEnquiryType"
    <asp:Parameter Name="Domain" Type="String" />
    <asp:Parameter Name="code" Type="String" />
    <asp:Parameter Name="meaning" Type="String" />
    <asp:Parameter Name="enabled" Type="Int32" />
    <asp:Parameter Name="Link" Type="String" />

The dropdownlist using the above datasource is:

<asp:DropDownList ID="ddlEnquiryType" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource2"
DataTextField="meaning" DataValueField="meaning" Width="256px">

The TypeName entry is referring to a dataset that was created (.xsd file). We have a web.config connection string that looks like:

<add name="crmConnectionString" connectionString="Data Source=myservername;Initial Catalog=CRM;User Id=xyz123;Password=***************;Integrated Security=False;Connect Timeout=30;" providerName="System.Data.SqlClient" />

As I mentioned, this application works fine in VS2005, VS2008, and also when within SharePoint. - Until overnight, and the sharePoint server 'loses' whatever it needs regarding 'ObjectDataSource2'.

Can anyone shed light on this puzzle? If you need more information, then let me know.

Thanks in advance!

share|improve this question

We saw similar behavior a few years ago. It had to do with how the .NET runtime loads assemblies after it gets unloaded from memory (after a period of non-use, which sounds like what could happen with your application). This can be related to not using the fully qualified name of the assembly. If you have a SafeCode entry for a business layer DLL you are using, make sure it's fully qualified.

DLLName, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

as opposed to


Also verify references in ASCX are fully qualified.

Interested if that's the issue. Took us FOREVER to resolve that one. In the interim to work around the problem we created a command line application to ping the server every 5 minutes so users did not see an error in the morning in case what is outlined above does not resolve.

share|improve this answer
Hi John, Thanks for that. I think you're onto something there. We have not used the fully qualified name of the assembly, but used: <SafeControl Assembly="XYZ" Namespace="XYZ" TypeName="*" Safe="True" /> The above works in all the apps we've created internally, but I will enter a fully qualified name as you suggest and see what happens for this 'problematic' app we have. It's a shame, I am on holiday for two weeks from today, but as soon as I get back I will give that a go, and let you know asap. Thanks for taking the time to respond mate! Kind Regards, Ash – Ashok Jingar Jun 26 '10 at 15:05
Hi John, Sorry for taking absolutely ages to get back to you (long story), but I did try strong-naming, but the problem still crops up now and again. It seems to be linked to load-balancing. When this happens, the web application seems to 'lose' connection and cannot restore it until we do an IISRESET or Application Pool recycle. I think we need to dive deeper into how the load-balancing works. Kind Regards, Ash – Ashok Jingar Oct 12 '10 at 9:31
Sorry to hear that. You may try the app to ping the server every now and then until you are able to fully resolve. Good luck! – John Ptacek Oct 12 '10 at 14:07

Can you check the 12 hive logs, EventViewer to see any issues pertaining to the web application.

if it is sure that this is caused by the new application i suggest you write a custom log to find if there are any issues

share|improve this answer
Hi Thomson, Thanks for your reply. That's the first place we looked, event viewer, logs, etc. Event viewer just shows the error code again relating to 'ObjectDataSource2'. – Ashok Jingar Jun 8 '10 at 11:59

Are you seeing a persistent error where IIS shuts down the web app because of the persistent error, or just the single error and it doesn't work again?

I'd almost wonder if there's a nightly backup (or some other operation) on that data source that's interrupting your connection and it's simply failing after the connection gets interrupted.

Is the error time fairly consistent in your logs from night to night?

share|improve this answer
Hi webdes03, Thanks for your reply. IIS does not shut down the web app, but merely 'forgets' how to connect to a sql db we have working with the app. The app works, but as soon as you try to use a dropdown list (which is populated with data from the SQL db), it throws the error mentioned in my original post. I think there is some backup of the SQL database involved, but we have other web apps which also have this kind of setup - but we have no problems with those. I am on leave for a few more days, but I will investigate this properly on my return. Thank you very much! Kind Regards, Ash – Ashok Jingar Jul 9 '10 at 11:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.