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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

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

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :SharePoint
 
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


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.


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.


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

  

Hi,

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"

  

Hi,

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.

Regards

Hari

 


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

  

Hi,

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?

 


infopath 2007 Expected value type: end-of-string ! calculated field

  
Hello I am using infopath since there is no field with type date and time in InfoPath 2007. I created three fields one for date one, for hours, and one for minutes then I created forth field that concatenate the values of the three fields this field will be used as column in form template library used by my form. All seems good so far but when I tried to concatenate those fields go the following error Expected value type: end-of-string how can I solve this ? my xpath looks like ../my:calmomoDate../my:cbmomoHours:../my:cbmomoMunites Thanks  Momo

System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

  

I have written a web service and tested it and it works fine from the .asmx test page.

However, when I attempt to call it with a post I get this error: 

The remote server returned an error: (500) Internal Server Error.

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.Net.WebException: The remote server returned an error: (500) Internal Server Error.

Source Error:

Line 164:            myStream.Close()
Line 165:
Line 166:            Dim SomeResponse As WebResponse = XmlHttp.GetResponse()
Line 167:            Dim strm As Stream = SomeResponse.GetResponseStream()
Line 168:            Dim sr As StreamReader = New StreamReader(strm)


Source File: c:\inetpub\wwwroot\SCNet\App_Code\SCClientSvc.vb    Line: 166

Why does the test work fine but give a 500 error when I just try and get the response?


The remote server returned an error: (500) Internal Server Error.

  

I have a search box on my site. If I implement a search by typing any characters it would come up with the right search result; except one-- ampersand (&) symbol. Whenever I type in this symbol - only this character- mind you, it would come up with the following error: 

 

Server Error in '/' Application.

The remote server returned an error: (500) Internal Server Error.

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.Net.WebException: The remote server returned an error: (500) Internal Server Error.

Source Error:

Line 55:         string name = this.TextBox1.Text;
Line 56:         string tablename;
Line 57:         DataTable dt = NameSearchBeta.NameSearch.NameSearchRequest(account, name,true , out tablename);
Line 58:         if (tablename == "Error")
Line 5

How to add new range text in Rating Scale field used in survey on MOSS 2007

  

When we use the rating scacle fied to create question in survey. You can only set three range texts for each question. Is there any way to locate a range text for each range ? Such as below :

                                 low             normal          high       important        very important

                                 1                  2                  3               4                     5

First question about ...?  

 

Thanks all your help !

 

 


WCF - The remote server returned an error: (500) Internal Server Error.

  

Hello,

I have a .NET 4.0 Windows client that is consuming a WCF service that is hosted in IIS7 on a Windows Server 2008 Standard machine.

My Windows client application calls the WCF service to perform database synchronization.  The process can take some time depending on the amount of data that is being synchronized.

After about 3 minutes and 15 seconds, I receive the following exception:

Exception Type: System.ServiceModel.ProtocolException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message: "The connection to the website was closed by the site or by one of its servers"
Inner Exception Type: System.Net.WebException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Inner Exception Message: "The remote server returned an error: (500) Internal Server Error."

I can't figure out what is wrong.  I have tried the following:

  1. In IIS > my site > feature view > Error Pages > select 500 error > edit > selected detail error. Nothing extra was shown.
  2. Enabled WCF tracing on the server and the client.  Server trace log didn't produce any errors and the client trace log generated the error noted above
  3. Increased the follow

How to custom Rating Scale field to add more range text in survey on MOSS 2007

  

When we use the rating scacle fied to create question in survey. You can only set three range texts for each question. Is there any way to allocate a range text for each range ? Such as below :

                                 low             normal          high       important        very important

                                 1                  2                  3               4                     5

First question about ...?  

 

Thanks all your help !

 


Error calling Web Service. The remote server returned an error: (500) Internal Server Error

  

I am trying to extend my Sharepoing 2007 workflow using Ilove Sharepoint custom workflow actions. I have successfully installed ilove sharepoint exposing the ILOVE SHAREPOINT WORKFLOWS. the workflow however returns an error message 500 internal server error. When i try to access
the same using asp.net application it seems to work.

Web service code

using System;

using System.Collections.Generic;

using System.Linq;

using

Data returned from 1 field includes multiple answers!!

  

Hi, I have a database field that stores multiple letters and numbers separated by ,

An example of this: o,t,g,h,w,x,q,l,m,b,c,5,r,

Each letter or number can be referenced to another table in the database which includes an explanation of what each letter or number actually means! The trouble I have is that I do not know where to start in order to display the correct results.

Can anyone help with some code to kickstart me in the right direction? I have the code below and this allows me to display the data from the field.

<asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="SqlDataSource9" Height="50px" Width="125px" onpageindexchanging="DetailsView1_PageIndexChanging"></asp:DetailsView>

<asp:SqlDataSource ID="SqlDataSource9" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [field8] FROM [datafeed$] WHERE ([field1] = @field1)">

<SelectParameters><asp:ControlParameter ControlID="DropDownList4" Name="field1" PropertyName="SelectedValue" Type="String" /></SelectParameters></asp:SqlDataSource>


From the above example code each letter and

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?

Thanks

Rob


Categories: 
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