.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

Value does not fall within the expected range.

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :SharePoint
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];

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.

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!

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

"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.




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



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?


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?



ListViewControl - how to group items by their value, for eg. date range



I have a table containing courses, columns are 

Name - "Yoga Classes"

DateStart - "2/23/2010"

DateEnd - "2/24/2010"

I am using ListView Control to bind it, is there a way to display them and group them by Month? 

for eg.


Piano Class (10th Jan 2010 - 11th Jan 2010)
Guitar Class (10th Jan 2010 - 11th Jan 2010)


Yoga Class (15th Feb 2010 - 16th Feb 2010)

Thanks for help.

System.DateTime.AddDays: Value to add was out of range.


I'm getting the following error:

[ArgumentOutOfRangeException: Value to add was out of range.
Parameter name: value]
   System.DateTime.Add(Double value, Int32 scale) +7657639
   System.DateTime.AddDays(Double value) +19

The line from which this error originates has the following code:

expires = Now.AddDays(30)

It occurs irregularly and irreproducably. The server date/time is correct and set to GMT. I've heard that it could be some curiosity to do with timezones, but that is speculative.

It seems that we're some time from the year 10,000 yet, so I can't understand why adding thirty days to the current time could cause this! Any ideas? Culture settings perhaps?

How i find out light and dark color range??



I am showing preview of text in text box.

But if text color is light(Like white) and i want to show that text preview than text is not visible because textbox background color is white.

Can i get the range of dark and light color so i'll change textbox backgroun color accordingly.

Thanks in advance.

A connection that was expected to be kept alive was closed by the server.


When  i want to Call http://BDCRWSS/_vti_bin/BdcAdminService.svc Bdc AdminService in SharePoint Foundation  2010

the binding i use:

    <binding name="BasicHttpBinding_BusinessDataCatalogSharedService"
      closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
      sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
      hostNameComparisonMode="StrongWildcard" maxBufferSize="999999"
      maxBufferPoolSize="9999999" maxReceivedMessageSize="999999"
      messageEncoding="Mtom" textEncoding="utf-8" transferMode="Buffered"
     <readerQuotas maxDepth="99" maxStringContentLength="999999" maxArrayLength="999999"
       maxBytesPerRead="999999" maxNameTableCharCount="999999" />
     <security mode="TransportCredentialOnly">
      <transport clientCredentialType="Ntlm" proxyCredentialType="None"
       <extendedProtectionPolicy policyEnforcement="Never" />
      <message clientCredentialType="Use

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

When create a suvery using type Rating Scale, is it possible to create 5 range text?


When create a suvery using type Rating Scale, is it possible to create 5 range text?

Default range text only show 3 fields

Textwrapping with buttons not working as expected

Guys and Gals, Got a bit of a problem with my application. I am trying to get the text and buttons in a groupbox to wrap when the page size changes (i.e. gets too small to fit it all on the page.) I have inserted the TextWrapping="Wrap" into the TextBlock line but it refuses to wrap. I have tried everything I can think of for this. Am I doing something wrong or is it impossible to do? If someone could point me in the correct direction it would be greatly appreciated. I don't want to use a scroll viewer either. <Window x:Class="Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Width="Auto"> <StackPanel> <TextBlock >Load Data Mappings From File</TextBlock> <TextBlock TextWrapping="Wrap"> This task will truncate all existing data Maps and re-import from an excel spread sheet.<LineBreak/> </TextBlock> <GroupBox Header="File to Load" Name="groupBox1" Padding="10" Margin="10"> <StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center" Width=&qu

Encoding.ASCII.GetString(bytes) return string with not expected

Example   byte[] bytes = {  0x36,0x92,0x30,0x94}; string rs=  Encoding.ASCII.GetString(bytes) ; //result rs = ?60?   Is Wrong Result; Result Right is     '60". So this function should fix to properly decode two symbols ' and " Code ASCII ' is 0x92,Code ACII for " is  0x94
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