.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

Dim CalendarList As SPList = Web.Lists(NameOfList) error: value does not fall within expected range

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :SharePoint


The following line  is throwing error message " value does not fall within expected range "

Using Site As New SPSite(SitePath)

   Using Web As SPWeb = Site.OpenWeb()

    Dim CalendarList As SPList = Web.Lists(NameOfList) ''''' throws error

tha value of NameOfList is 'Project%20Calander'

the url of the list is 'http://dev/working/landing/testsite/Lists/Project%20Calendar/calendar_copy(1).aspx'

Its the correct name of the list so not sure what as it could be expecting?


View Complete Post

More Related Resource Links

Calculated Columns in a Form Library receive error: Value does not fall within the expected range.


I have a forms library that posts the date the form was created. We would like to create a calculated column that allows us to look at these forms based on the month and year they were created. I had created a calculated column that extracts the month and replaces the number with a text string by using an if statement; "IF(MONTH([Proposal Date])=1,"January","") It goes on to evaluate each month and replace the number with the text string. This formula worked for quite some time, though now when I try to add any calculated columns or edit any existing calculated columns on this form library I receive the following error: Value does not fall within the expected range. Now my existing calculated columns (like the one above) do not work and I can not create new calcualted columns. Any insight would be awesome as this has been plaguing me for a couple of months now.

Projects giving the error "Value does not fall within the expected range."


I have a solution that contains four projects. This morning, when I opened up the solution in SQL Server Management Studio 2008, three of the projects gave the error "Value does not fall within the expected range" and were marked as unavailable. I removed them from the solution. When I attempt to add them back to the solution, nothing happens. How do I fix this?


AddPermissionCollection returns error: Value does not fall within the expected range



I'm trying to add permissions to a new subsite by getting the permissions from an existing one using the following method from the _vti_bin/Permissions.asmx webservice:

    XmlNode xnode = spPermissionsWS.GetPermissionCollection("http://SharePointServer/MyNewSite", "Web");

    spPermissionsWS.AddPermissionCollection(http://SharePointServer/MyNewSite, "Web", xno

Value does not fall within the expected range.

I am trying to upload a csv file into a sharepoint list. (as demonstrated in SDK sample that i downloaded from here http://www.microsoft.com/click/SharePointDeveloper/html/Default.html)                 //open the CSV file for reading using (StreamReader fileRdr = File.OpenText(paramFileName)) { // connect to the site collection using (SPSite spSite = new SPSite(paramWeb)) { //open the web using (SPWeb spWeb = spSite.OpenWeb()) { //get the List from the site SPList spList = spWeb.Lists[paramList]; //read the files in the header string line = fileRdr.ReadLine(); string[] fieldNames = line.Split(splitArray); //get an Array of field from the List - this assumes that the fields name match // we need the field id when inseting rows SPField[] spFields = new SPField[fieldNames.Length]; for (int looper = 0; looper < fieldNames.Length; looper++) { string strName = fieldNames[looper];

Cannot access Workflow from List Item menu: "Value does not fall within the expected range."


We are using Sharepoint 2007 sp2.

I am using Sharepoint Designer 2007 to create workflow for some List, suddenly I cannot acess some list items' workflow,and was informed  "Value does not fall within the expected range." , but other items are all ok.

I don't know whether this is concerned with the service pack 2, I installed sp2 yesterday.

Value does not fall within the expected range? Using Internal Field Name returned from SPListItem Fi

Here's the code.

myDocument is an SPListItem.
string fieldName = "Document Category";
string internalFieldName = myDocument.Fields[fieldName].InternalName.ToString();
Type myType = myDocument[internalFieldName].GetType();
internalFieldName gets the value "Document_x0020_Category"

But myType = myDocument[internalFieldName].GetType() throws an exception error of "Value does not fall within the expected range"??

If the fieldname is found in the fields collection, and returns the internal field name, why would using the internal field name as an indexer into the document throw an exception?

myDocument has a value in field "Document Category" when I view properties on the document in the document library! I am expecting the field type to be of

Document CopyTo() Failed with "Value does not fall within the expected range"


Hi there,

I have a very strange issue...when I want to copy document file from document library A to another B (in C# code - document.CopyTo(destinationUrl)) I get an error "Value does not fall within the expected range".

But when I want to copy document file backwards from B to A with the same code, it works!

So I made a test with SharePoint feature "Send To"...I select file in doc lib A and choose option Send To -> Other Location...here I selected doc lib B and click OK to copy the file, but the operation also failed with the error "Unable to contact the source server." if I make backwards operation (from B to A) it's works again!

Am I missing something or what? Both Document libraries are the same...I don't know where the problem is :\

Thanks for help!

"Workflow Soap: GetWorkflowDataForItem failed" + "Value does not fall within the expected range"



I am getting "WorkDLC Server                     Workflow Features              7397 Warning  Workflow Soap: GetWorkflowDataForItem failed Item: http://xxx/Lists/News/Attachments/168/System%20Administrator%20Officer%20%20%20(%20Job%20Profile%20).docx Value does not fall within the expected range.  " error in log file and in event viewer i am getting error with event id: 7397

Kindly help me.




DateTime values in external lists must fall within the range of 1/1/1900 and 12/31/8900


I have a WCF service and I have setup a BCS External Content Type to. All working fine, I have created a default list which displays the list of records. Problem is though one of the fields in the WCF is a datetime and if it has a value then all is fine but when you set the datetime field to nothing in the WCF I get the list showing all right but when I click on the record to get the default item form I get the following error. If I use a infopath form as default then it fails.:

DateTime values in external lists must fall within the range of 1/1/1900 and 12/31/8900. This form cannot be displayed because the external item contains this date: 01/01/0001 00:00:00

Obviously the datetime field minimum value is 1/1/0001 or something like that. Doesn't like nullable date fields. I don't want to set the field to 1/1/1900 as I want the default item form to display 1/1/1900 as a null or empty, don't want to make the field string as having the date fields in the list helps with sorting. I don't want to create specific list webpart or form at this stage but use the default list a form the Sharepoint designer creates.

Any ideas on how to handle or make null datetime field go back to the ECT?



Object expected error


<input type="button' onclick="timeoutCheck()" value="Click Me!" />

it tells me Microsoft JScript runtime error: Object expected


timeoutCheck() is my script function that i declared above the input tag

can anyone tell me why i am getting this error

hello i need help , any ideas are welcome i have been working on this for two weeks now and cannot seem to be able to advance

"Out-of-Range" Error When Passing DateTime (DD/MM/YYYY) into Stored Procedure

Hi everybody, I hope some of you will be able to help me regarding this datetime problem. The query in the stored procedure doesn't accept DD/MM/YYYY format, although all dates are being saved in the format of DD/MM/YYYY hh:mm:ss. Example of query that throws the error: @sDate = '31/8/2010' @eDate = '1/9/2010' SELECT * FROM tb_Schedule where scheduledate >= @sDate and scheduledate <= @eDate  Error:  The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value FYI, the SQL Server 2005 is defaulted to British English(2057)for all logins and the DB server itself and my server Regional and Language is set to English (United Kingdom). Any help will be appreciated. Thank you very much.  

CS1002: ; expected error

Whenever I run the following code:   <% @ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RD1._Default" %> <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < < html xmlns="http://www.w3.org/1999/xhtml">head runat="server">   <title>JavaScript</title>   <script language="javascript" type="text/javascript">   { confirm(   function Show()'You entered \n\n' + document.getElementById('<%=txtTextbox.ClientID%>').value);//var a = document.getElementById('<%txtTextbox.ClientID%>').value;   }   </script> </ < head>body>   <form id="form1" runat="server">   <div style="height: 247px">     <asp:TextBox ID="txtTextbox" runat="server" ></asp:TextBox>     <asp:Button ID="btnClick" runat="server" Text="Button" OnClientClick="Show()" onclick="btnClick_Click" />   </div>   </ </ </form>body>html>   It shows the following error: Compilation Error Descript

Membership web part 'Object Expected' error

I have placed a Membership Web Part on my 'My Site'/'My Content' page and everything was working just fine until the number of memberships supassed the total number that the control is set to display. When this happened, a link appeared at the bottom of the web part with the following wording 'Show 8 additional memberships'. When I click on this link I receive an 'Object Expected' javescript error. When I look at the code that is generated on the page the <a></a> tag for this link appears as follows ... <a class="ms-vb" id="1SPS_MEMMICSRCHRES_Link" href="javascript:ShowHidePrivacyRow('SPS_MEMMICSRCHRES','1', '1SPS_MEMMICSRCHRES_Link', 'Hide 8 additional memberships', 'Show 8 additional memberships');"> When I do a search for the ShowHidePrivacyRow() function it does not appear on the page and I can not seem to find it in any of the SharePoint out of the box .js files either. Could this be the cause of the 'Object Expected' error? If so, how do I solve this and why is an out of the box web part causing javascript errors. This is something I would expect from a product that is still in Beta, not a production release.

Unable to Customize Custom Lists. Sharepoint Error: User cannot be found.

I am not sure what the best way to put/describe my issue . I am unable to customize my custom list. Steps: 1. Login to sharepoint site. 2. Site Actions -> Site Settings 3. Under Site Administration -> Site Libraries and lists 4. Clicked on a custom list.   Error: Error User cannot be found.   Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: 4063bf58-9cb7-4204-8cc4-cc2889abffe3 Date and Time: 9/9/2010 5:51:58 PM   I figured this may be an issue with site permissions, so I have went into site permissions and removed and re-added Administrator into Homeowners group.   Thank you in advance.   Howie

Sharepoint 2010: Get error: You do not have permissions to have lists and pages within My Site.

I am using the administrator login for the sharepoint 2010 farm.  I'm able to access My Site.  However, when I click on My content, I'm getting You do not have permissions to have lists and pages within My Site.   Any ideas?   Thanks.

IE script error (object expected) on treeview

Hi,Just starting out with the CSS adapters and have implemented a treeview. Works fine in Firefox butIE shows a script error (bottom left) when moving over the tree view. It still goes to the page but there is obviously an issuePage code is in a master page below is the source view in IE<script type="text/javascript">//<![CDATA[var theForm = document.forms['aspnetForm'];if (!theForm) {    theForm = document.aspnetForm;}function __doPostBack(eventTarget, eventArgument) {    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {        theForm.__EVENTTARGET.value = eventTarget;        theForm.__EVENTARGUMENT.value = eventArgument;        theForm.submit();    }}//]]></script><script src="/countrystovesdirect/WebResource.axd?d=KFBAefcFIGtf1hLcg-tm2g2&amp;t=634172878000000000" type="text/javascript"></script><script src="/countrystovesdirect/WebResource.axd?d=S53dmqAagvRk26h8P3H5I9pat_c17l9dW6l04Xdzs9Ai0yVsPFqiIf_M-ylpvzDHp0GeDDnhMnCondcznfbzzw2&amp;t=634201551800000000" type="text/javascript"></script><script src="/countrystovesdirect/WebResource.axd?d=S53dmqAagvRk26h8P3H5I9pat_c17l9dW6l04Xdzs9ACFhsw16G3-NkgCeZFVUFx6W

Package Migration Wizard error -- Index was out of range

I am unable to migrate any DTS packages, from a SQL Server 2000 package, from a structured storage file, or from a DTS package imported into SQL2005 (Developer Edition, 32 bit).  Running the Package Migration Wizard, every time I get to the List Package screen, i get the error below.  I haven't found any other mention of this so far.  Anyone else seen this error or have suggestions?"Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index (mscorlib) ------------------------------Program Location:    at System.Collections.ArrayList.get_Item(Int32 index)   at WizardUI.ListPackages.UniquePackagewithCurrentVersion(PackageInfoCollection m_pInfoCol)   at WizardUI.ListPackages.OnEnterPage(EventArgs e)   at Microsoft.SqlServer.Management.UI.WizardPage.RaiseEnterPage()   at Microsoft.SqlServer.Management.UI.WizardForm.NextPage(WizardPage nextPage)   at Microsoft.SqlServer.Management.UI.WizardForm.Next_Click(Object sender, EventArgs e)"
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