.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

The property or field has not been initialized. It has not been requested or the request has not bee

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :SharePoint

Hello, when a try execute this method, i receve always this error message.



private void button1_Click(objec

View Complete Post

More Related Resource Links

Server-side validation on an Entity Framework required field (property) does not work!

Has anyone had issues getting server-side validation on an Entity Framework required field (property) to work? The data type is a string (nvarchar). Server-side validation for required fields of other data types WORK fine. Only string fields have issues. I get the following error on UpdateModel(obj); of my POST method within the controller. Exception Details: System.Data.ConstraintException: This property cannot be set to a  null value.Source Error: Line 4500:                OnTextChanging(value);Line 4501:                ReportPropertyChanging("Text");Line 4502:                _Text = StructuralObject.SetValidValue(value, false);Line 4503:                ReportPropertyChanged("Text");Line 4504:                OnTextChanged(); I've even tried data annotations like this but it seems to get ignored.     [MetadataType(typeof(ObjMD))]     public partial class Obj     {    

How is the Path property set in Request.Path?

I have a website which is running on a locally on IIS, and have noticed that I can display an image in /Image/MyImage.jpg from an aspx file in the web root directory with either of the following html:<img src="Image/MyImage.jpg...> or <img src="../Image/MyImage.jpg...>Even though these point to different locations, and <img src="../Image/MyImage.jpg...> is incorrect, they both work and the image is displayed correctly.I've looked into this, and in Application_BeginRequest(), HttpApplication.Context.Current.Request.Path is "/Image/MyImage.jpg" in both cases, which is correct.If I run the website on the local ASP.NET development environment (localhost), it never calls Application_BeginRequest() for the image, and only <img src="Image/MyImage.jpg...> works, which is what I would expect.How is the Request.Path variable set? I find it confusing that two different resource locations would cause the path in Request.Path to point to the same location.

How to change the value of a foreign key field/navigation property?

How can I change the value of a foreign key field?  E.g. in the Product list view instead of the value of the field Supplier.CompanyName I want to display the Supplier.Region. I searched my whole code to get a clue, googled for "change navigation property" and looked in the docs but unfortunately I did not find any hint. If you know where to find the answer, please let me know too the source of your knowledge!          

SSRS 2008 R2 Dataset Field Value Property Data Type not numeric

We're building SSRS 2008 R2 reports using SSAS as data sources.  There are several occaissions where the data types of certain dataset field values that represent cube measures are not numeric.  As such, when these fields are used in an aggregate function they throw an error.  Is there a way to remedy this in the dataset? Thanks for your help.

OOTB Approval Workflow SharePoint 2010 - Blank "Requested By" field appears in Task Item edit/view f



I am having a simple OOTB  approval worflow associated to the simple document library. Task is created when an document is uploaded to the library.  When I click the task item in task list, I see a blank field "Requested By"  right below the "Status" column and I am unable to understand from where this field is coming and how to populate this field. Any help would be great...

An object reference is required for the nonstatic field, method, or property 'object.GetType()'


I'm getting this error, what i'm missing?

error: An object reference is required for the nonstatic field, method, or property 'object.GetType()'


static public void RegisterScriptMethod(System.Web.UI.Page page, string methodName, string methodBody)


StringBuilder sb = new StringBuilder();


"<script language='javascript'>");


"function " + methodName + " {" + methodBody + "}");



//page.RegisterClientScriptBlock(methodName, sb.ToString());

Taxonomy Field Picker in Custom Webpart Property Panel.


Hi Guys,

How can i Use Taxonomy Field Picker like in Content Query Webpart Property Panel in Custom Webpart.



Thanks Ron

A field or property with the name 'FieldName' was not found on the selected data source


I'm attempting to load a GridView dynamically on a button is pressed.

The gridview has AutoGenerateColumns="True" (set in skin definition) and has a declarative column definitions as follows:

<asp:GridView runat="server"
        SkinID="GridViewDetail" ID="gvReport"
            <asp:TemplateField HeaderText="Date">
                        <asp:LinkButton  OnClick="

ExecuteReader problem in web form: Connection-property not initialized


I changed my data source from an access-db to a sql-server, now i still have to fix some problems Undecided

When I want to load a value from a sql-database into my web form (to display a default value), I get an ExecuteReader error ("Connection-property not initialized").

I dont know where to set the connection property in my code.

Dim con As New System.Data.SqlClient.SqlConnection()
Dim myCommand As New System.Data.SqlClient.SqlCommand
Dim SqlCon As String = "Data Source=blablabla\SQLEXPRESS;Initial Catalog=Bill;Persist Security Info=True;User ID=xxx;Password=password"
con.ConnectionString = SqlCon
Dim reader As System.Data.SqlClient.SqlDataReader = myCommand.ExecuteReader() 

The error occurs in the last line. Do I have to set the connection property in the SqlCon string?

A field or property with the name 'User_x0020_Name' was not found on the selected data source.


I am trying to bind the XML data to a datagrid from an XML file.  I don't know why I am getting the message: "A field or property with the name 'User_x0020_Name' was not found on the selected data source."

The "User_x0020_Name" field does exist in the XML file.  This is a portion of the XML file.

<?xml version="1.0" encoding="utf-8" ?> 
<DataSet xmlns="http://www.----------.com">
 <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
 <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
 <xs:choice minOccurs="0" maxOccurs="unbounded">
 <xs:element name="Table">
 <xs:element name="User_x0020_Name" msdata:ReadOnly="true" minOccurs="0">
 <xs:restriction base="xs:string">

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more i


I have a project that works fine when I run it locally but when I put it on our new Windows 2008 running IIS 7 I get the following error.  I have done some research and nothing seems to solve my issue.  I am using VS 2010 and the entity framework and the error appears to occur when I am trying to bind data to the view?

Thanks in advance


Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

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.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Source Error:

An unhandled exception was generated during the execution of

sharepoint 2010 binary field Property Not Editable: This property can only be modified by an adminis


I have added a binary property to the user profile. I update this field from a piece of c# code.
I get the error "binary field Property Not Editable: This property can only be modified by an administrator"
When I alter the service application and ad my account to the administrator group it works. The problem is that
I have to grant every user this right for this to work. Can anybody help me for this code to work without
having to add all the users to the service application administrators group?

My code is posted below. Have tried with and without elevated privs.

            SPSite site = EnsureMySiteContext();

                site.RootWeb.AllowUnsafeUpdates = true;

                var serviceContext = SPServiceContext.GetContext(site);

Adjust document permission based on custom property-field (owner person or group)


I would like to setup a workflow so everytime a user adds a new document to a document library the workflow adjusts the documents permissions.

I've added a new field to the document library settings which I called "Owner". This field searches persons or groups in the active directory. The person of group that I fill in here has to get contribute-permissions for this document. This process needs to be automatic so I think I have to build a workflow.

Who has got experience with this? Who can help me? Can I do this with the Sharepoint Designer?

The system we use is a sharepoint server WSS3.0

how to get dropdown list data VALUE FIELD property in JavaScript



im getting  'ON' as value instead of its actual value

How to Create Auto increment Request number for browser enable infopath form field Programmatically?

hi all,

i have created an infopath which have one request no. field and it will auto increment when click on add new item on sharepoint Document library

field contains (highest value of column request no. +1 )  when infopath will open in browser.

What i have done on this:i have create new data connection on sharepoint library and then pick document library then choose ID field and insert function in the field max(ID)+1.

help me



connection property has not been initialized


hi all

i am developing winforms application in c#

My ConnectionString in app.config is 


<add name="MyConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\UttamPayDB.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property
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