.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

New Linq to Sql object crashing entire site

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net

I have a site with many application roots below the main root

  • mainSite (application root)
    • admin
    • subfolder1
    • subfolder2 (application root)

I have a database connection saved in my database explorer that when test, does work.  I created a Linq to SQL in the subfolder2 application and the connection string is saved in /subfolder2/web.config.  This works absolutely perfectly.

Today I attempted to go in and create the admin page (as part of the primary root, but in a folder) for this newest subfolder application - like I have done a million times.  First I create the empty Linq to Sql object, everything continues to work.  But as soon as I add the table for the new application to the dbml, everything dies.  First I get the Custom Error screen telling me to turn off custom errors, and when I do,  I get the blank 500 server error on EVERY page, including html and css files, and not just in the root application, but in the nested applications as well.

First, what on Earth could possibly be so bad that IIS stops serving html files?

Second, why would the dbml editor allow me to add the table if there is something wrong with it?

Third, why is this functioning in other applications?  Is it some sort of duplicate nested information issue for either t

View Complete Post

More Related Resource Links

Build an Easy Maintenance Intranet Site: Using Office Docs, File System Object, and OLE Structured S


If you've ever needed to build an easy-to-maintain intranet site, here's a solution based on Microsoft Office documents. Many sites require constant updating of their HTML, but the use of Word documents can simplify the process. This article details the construction of a human resources site that exploits the File System Object (FSO), OLE Structured Storage, and ActiveX capabilities of Word documents. This allows the HR staff to copy their revised or newly created Word files to the site, dynamically generate a list of links to their files, and free IS from the constant recoding of HR updates into new HTML pages.

Josef Finsel

MSDN Magazine March 2000

User Alert Management for a specific list versus entire SharePoint site?

It seems that to be able to manage User Alerts, one must have Full Access to the entire SharePoint site - and then use => Site Settings > User Alerts. Ideally, I would like to be able to grant access to users to only be able to manage alerts for a specific list. Is this possible (without having to do any programming) and, if so, how? If such access is only available at the site level, I will simply create a Permission Level that allows one to only "Manage Alerts" Thanks in advance for any assistance. Dave

Custom Theme for entire Site Collection

I created a theme with custom css for sharepoint 2010 Is it possible for me to use my custom CSS and have it be a selectable theme from each site without me having to modify the master pages of each site that wants to use the theme?

SharePoint 2010 Publishing Site : Operation is not valid due to the current state of the object.

  I think as usual, the new version of SharePoint 2010 has a lot of problems. the below messege appear in a publushing site (FBA) enabled and when I try to access the pages list or even approve a page of accessing the SiteCollectionImages list and ......... etc every link produce the below error. I'm very frustrated with 2010.  Server Error in '/' Application. <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x8107058a): <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object.] Microsoft.SharePoint.Library.SPR

Object Cache set with Portal Super User accounts. Access denied to site.

I have the same issue on multiple farms. In this example i'll outline this problem for a three tier farm. SharePoint web server SharePoint Application server (hosts central admin) Sql server After installation and configuration i have created two web applications (claims based auth with NTLM). https://portal.contoso.com https://mysite.contoso.com The client connects on the URLs to the web server (1st tier). All is working correctly and they can access the portal and their mysite. The log file keeps reporting that i need to configure the user accounts for the Object Chache. So, i looked up the required steps and executed these conform mcrosoft guidelines (http://technet.microsoft.com/en-us/library/ff758656.aspx) All the steps run seccesfully. But when i connect to the URL i now get an access denied (even with the administrator who is site collection administrator) In the log file i get the following to lines when i connect to the site. Unknown SPRequest error occurred. More information: 0x80070002 Unknown SPRequest error occurred. More information: 0x80070005 I have exact the same issue on two other farms. Marc

How to all the Subsites and Site Collections under a top level site collection using client object m

Hello Everyone, I need to know how to get all the subsites and the site collections under a top level site collection using client object model in SilverLight. When I use WebCollection webcoll= ctx.Web.Webs I'm getting the getting subites but i'm not getting the RootWeb and Othe SiteCollections created under the Top Level site collelction.

Site Manager Error object reference error line 145 SiteManager.aspx SmtPostBackHandler1.UniqueID

Hi I am getting error bellow irrespective of if its IE or firefox Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 143: Line 144: Line 145: <a onclick='javascript:__doPostBack("", "Refresh=<%= TreeView1.SelectedNode.Value %>")' style="cursor:pointer"> Line 146: <SharePoint:EncodedLiteral runat="server" text="<%$Resources:cms, SmtRefreshLink%>" EncodeMethod='HtmlEncode'/> Line 147: Source File: c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SiteManager.aspx Line: 145 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer.get_WebServerRelativeUrl() +148 Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer.get_CachedList() +149 Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer.get_AutomationId() +178 Microsoft.SharePoint.Publishing.Internal.WebContro

Urgent How to Create it ,Object Data Source ,Linq and sql or other any way


my query is



my data is

HR    HR    Rec    Records    Leave    Leave Records    HRL.0001    Policy and Process for leave record.    27.06.2010    30.06.2010    WIP    Edlink
HR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    Edlink
HR    HR    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    Edlink
HR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010  

Object Oriented Linq


Hello programmers,

I don't know if this is the right forum to post this in but here it goes anyway...

I am wondering into the unknown field of OOA and was looking for a way to separate my business logic from my UI. A small example is as followed:

Two DropDowns where the second one is depended on the selection in the first DropDown. You have Cars, planes, etc. inm the first DropDown and Toyota, Chrysler, etc in the second (depending on the value in the first DD.

I have som Lin syntax. The file is situated in the App_Code folder and NOT as code behind.

    public class GetProductCategoriesClass

        //Henter data fra databasen og gemmer det som ProductCategory
        public static List<ProductCategory> GetProductCategoriesMethod()
            DataClassesDataContext cate = new DataClassesDataContext();
            return (from p in cate.ProductCategories.ToList<ProductCategory>()
                    select p).ToList<ProductCategory>();


    public class GetProductSubCategoriesClass

        //Henter data fra databasen og gemmer det som ProductSubCategory
        public static List<ProductSubCategory> GetProductSubCategoriesMethod()
            DataClassesDataContext cate = new DataClassesDataContext();
            return (from p in cate.P

Unable to Create Object Variable for Linq Data Class


For some unknown reason I suddenly am unable to create an object variable for a Linq Data Class. If I create a new project and try the process again with the same database everything works as advertized.

The code I am using is Dim db As New RoggDataContext  which gives me an error on the object variable "db": Overload resolution failed because no accessibility 'NEW'  accepts this number of arguments.

I have looked inside every file in the Web Project like the web config to check the connection string, gobal, and designer.vb looking for any errors whit no JOY.  I also tried to create a new form and code behind with a button and received the same error.

This is mind blowing because as I already stated, I can create a new Web Site and the problem goes away.

Any help is appreciated!



How to make linq Object Serializable... 'System.Data.EnumerableRowCollection is not marked as Seriz


Dear All,

Is it possible to make the linq object as serializable. I need to pass the serialized Data as parameter to the Remoting Method.

My LinQ Query is as follows

 Dim LinqQuery = From R In dsEdit.Tables(0) _

                    Where R.Field(Of Integer)("ID") < 400 _

                    Select R


The Definition of ZipObject is as follows.



  Public Function ZipObject(ByVal obj As Object) As Byte()

        Dim ms

How can i convert my entire asp.net web site project to asp.net web application project


How can i convert my entire asp.net web site project to asp.net web application project


i want to use Microsoft Ajax Minifier but i could not find how to implement it to the asp.net web site project


so for using this feature i might convert my asp.net web site to asp.net web application


thanks for all kind of help

How to update value directly in class Object using Linq



I have a class object which is basically kind of hierarchy and looks like this when I convert that to XML.


  	<SKU>SKU 1</SKU> 
	<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
  			<SKU>SKU 2</SKU> 
  			<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
  					<SKU>SKU 3</SKU> 
		  			<ConfigurationStatus>Not Configurable</ConfigurationStatus> 



So you can see that I have "objectComponent" which is kind of hierarchy and that hierarchy can be upto any level.

Now I need to update <quantity> value where <sk

Add a field to site columns using Client Object Model



I am having an issue when trying to add a field to the web.AvailableFields.  I am using web.AvailableFields.AddFieldAsXml(...)  but it seem that you need to associate the field with a list.  Is it not possible to add a field to the site collection columns using the client object model?

What I am doing is creating a content type and then adding fields to this content type, if the fields dont exist I what to create them but an having a problem doing so.



Create SPUser object using user credentials on claims based site.



I would like to create SPSite object and pass user token as an argument to make sure all operations are executed with SharePoint security trimming. Inside SPSite I am reading some file content using File.OpenBinaryStream() method.

I am not sure if there is a way to create SPUser using user credentials. I am able to get SPUser by getting it from SPWeb.AllUsers collection using user login name. However it doesn't work for claims based sites as login name for these users looks like i:0#.w|domain\username. 

Am I allowed to user code like this:

SPUser user = web.AllUsers["i:0#.w|domain\username"];

to get SPUser object? I know that 'w' from 'i:0#.w' string means that it is Windows user. What do other symbols mean? Is there any method which can generate login name from user credentials so I may use it to get SPUser from AllUsers collection?

Possibly there are some other ways to execute code for SPSite under some SharePoint user privileges?

P.S. All my code is running out of SharePoint context. I have tried to user windows impersonation but got Access Denied error.

Thanks beforehand for any help,


Start site workflow using silverlight client object model.



I created a sequensial site workflow using VS2010. Its working fine. I want to start it manually using silverlight client object model.

Can any one help me how it can be done?

Copy entire list including contents to a different SharePoint site


Hi: Just using the GUI in WSS 3.0, is it possible to copy an entire list including content from one site to another - asssuming I have admin rights to both sites? If so, how does one go about it?

Thanks in advance for your help.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend