Feeds:
Posts
Comments

Archive for the ‘Development’ Category

Sometimes when you want to deploy your solution or custom web part on the server , However everything is OK and the code is built successfully but you encounter this error.
Object reference not set to an instance of an object
It may be because of the existing deployed solutions. Mark Arend has written a good post [...]

Read Full Post »

Today I was working on my custom web part. One of my questions was : after pressing submit button how to update a people and group field in the destination list.
I tested many ways and they gives me this error :
Invalid data has been used to update the list item. The field you are trying [...]

Read Full Post »

I was trying to create a method to delete all items in a sharepoint list .
here is the code , It’s simple but a question remained for me at the end :

        public void DeleteAllRecords()
        {
            SPList list_a = web.Lists["UserDocs"];
            SPListItemCollection itemsCol = list_a.Items;
            if (itemsCol.Count > 0)
                for (int i = itemsCol.Count-1; i > -1; i–)
                {
                    [...]

Read Full Post »

Today I was trying to develop a web part to use as “Contact Us” . I think it is a good sample in CodeProject site . but there was something wrong after I deployed  it. Every time I hit F5 or Refresh button on the browser,  the button on the web part fired again and [...]

Read Full Post »

You may have seen this error message if you have tried to update a “People and Group” or “User” field by a simple string ( like “Domain\Username” ).
Invalid data has been used to update
the list item. The field you are trying to update may be read only.
I found that you should use SPUser field type in this situation. [...]

Read Full Post »