Information query SQL in list custom SharePoint 2010

Hello Guys,
Need some help with a custom list on a project site. 
Prepared the following code:
SELECT 
Webs.Title,
Lists.tp_Title,
Webs.TimeCreated,
nvarchar3,
nvarchar4,
nvarchar5,
nvarchar6,
nvarchar7,
nvarchar8,
ntext1,
ntext2,
nvarchar9,
nvarchar10
FROM Webs 
INNER JOIN Sites ON Webs.SiteId = Sites.Id 
INNER JOIN UserData ON Sites.Id = UserData.tp_SiteId 
INNER JOIN Lists ON UserData.tp_ListId = Lists.tp_ID
WHERE Lists.tp_Title = 'ListName' AND
Webs.Title = 'ProjectName' 
ORDER BY Webs.Title
In database SharePoint_Content.
The code works fine, but it brings me all the information I need. 
But do not bring me what options were marked in the list by the user. 
The question is: Is there any field that I can pull only the options that have been marked? 
Thanks for your help.
Obrigado por contactar o fórum Microsoft Technet!

Can you describe as to what you are trying to achieve? Writing T-SQL queries and fetch data from SharePoint databases is not supported.
This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

Similar Messages

  • How to Create Custom List in SharePoint 2010 Programmatically ?

    Hi,
    i have tried the following way, 
    http://devendra-sharepoint.blogspot.in/2012/01/creating-list-programatically-in_30.html
    But i am not able to create list.
    Becuase i am getting the following error.
    'Microsoft.SharePoint.SPWeb' does not contain a definition for 'EnsureList' and no extension method 'EnsureList' accepting a first argument of type 'Microsoft.SharePoint.SPWeb' could be found (are you missing a using directive or an assembly reference?)
    Please advice.
    Thanks,
    Aasai

    Hi,
    You can use list.Fields.Add() to add column in list. See below blog:
    http://www.c-sharpcorner.com/blogs/3764/create-sharepoint-list-programmatically.aspx
    Use this to delete list:
    http://www.c-sharpcorner.com/UploadFile/54db21/delete-list-in-sharepoint-2010-programmatically-using-vs-201/
    See this for remove user/group from list:
    http://www.c-sharpcorner.com/UploadFile/54db21/remove-group-permission-to-list-in-sharepoint-2010-programma/
    Hope it could help
    Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • Reading and writing data to a list in Sharepoint 2010.

    I'm having difficulty writing data to a list in sharepoint 2010, the reading the information is going fine, but I just tried writing data, and it's not working well.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using ListQuery.StudentsList;
    using System.Xml.Linq;
    using System.Net;
    namespace ListQuery
    class Program
    static void Main(string[] args)
    XNamespace ns = "#RowsetSchema";
    ListsSoapClient soap = new ListsSoapClient();
    XElement query = new XElement("Query");
    XElement options = new XElement("QueryOptions");
    XElement view = new XElement("ViewFields");
    soap.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
    XElement list = soap.GetListItems("Students", null, query, view, "900001", options, null);
    foreach (XElement descendent in list.Descendants())
    descendent.SetAttributeValue("ows_fullName", "I am sparticus");
    soap.UpdateListItems("Students", list); // ERROR LINE
    var asdf = from x in list.Descendants()
    where x.Name == ns + "row"
    select x.Attribute("ows_fullName").Value;
    foreach (string blah in asdf)
    Console.WriteLine(blah);
    Console.WriteLine("\n\t--Process Completed--");
    Console.ReadKey(true);
    I wrote a comment showing the line where the code had a break in execution. The error I'm receiving is this,
    "Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown."
    Any help is appreciated, thanks!

    Puil, I decided to go with your idea, but when trying to connect to the data source at listdata.svc using the add data connection wizard, at the very end upon clicking finish I get an error "System.Exception", this is what shows up in my error list.
    Error 1 Custom tool error: Schema specified is not valid. Errors:
    (0,0) : error 0005: The 'Name' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Relationship' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item_CreatedBy' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0005: The 'FromRole' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Relationship' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item_ModifiedBy' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0005: The 'FromRole' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Relationship' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item_CheckedOutTo' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0005: The 'FromRole' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Name' attribute is invalid - The value '__10Item_CreatedBy' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Role' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Type' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0019: Each type name in a schema must be unique. Type name 'Microsoft.SharePoint.DataService.' was already defined.
    (0,0) : error 0005: The 'Name' attribute is invalid - The value '__10Item_ModifiedBy' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Role' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Type' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0019: Each type name in a schema must be unique. Type name 'Microsoft.SharePoint.DataService.' was already defined.
    (0,0) : error 0005: The 'Name' attribute is invalid - The value '__10Item_CheckedOutTo' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Role' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Type' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0019: Each type name in a schema must be unique. Type name 'Microsoft.SharePoint.DataService.' was already defined.
    (0,0) : error 0005: The 'Name' attribute is invalid - The value '_10' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'EntityType' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Name' attribute is invalid - The value '__10Item_CreatedBy' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Association' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item_CreatedBy' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Role' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'EntitySet' attribute is invalid - The value '_10' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Name' attribute is invalid - The value '__10Item_ModifiedBy' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Association' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item_ModifiedBy' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Role' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'EntitySet' attribute is invalid - The value '_10' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Name' attribute is invalid - The value '__10Item_CheckedOutTo' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Association' attribute is invalid - The value 'Microsoft.SharePoint.DataService.__10Item_CheckedOutTo' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TQualifiedName' - The Pattern constraint failed.
    (0,0) : error 0005: The 'Role' attribute is invalid - The value '__10Item' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.
    (0,0) : error 0005: The 'EntitySet' attribute is invalid - The value '_10' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed. c:\users\wileym\documents\visual studio 2010\Projects\ecomms\ecomms\Service
    References\studentList\Reference.datasvcmap 1 1 ecomms
    It seems the schema is all wrong... Any help would be appreciated.

  • Uploading Multiple Documents To a List Item sharepoint 2010

    hi Guys ,
    Is there a way we can enable (out of the box )Uploading Multiple Documents To a List Item sharepoint 2010 ?
    cheers

    No, There is no OOB way to do the same you have to build a custom Page/Control OR customise OOB Form to attache multiple files and that will be through integration of ajax based control (multiple file uploader.)
    the other way to do the same is provision a custom field. we have done this for our many  clients.
    Hi, I also encountered the same problem, could u pls provide detailed information by a custom field?

  • Ribon mising when first opening a list in Sharepoint 2010

    Hello.
    When opening a list in SharePoint 2010, I do not get the ribbon. If I click on a list item, the ribbon appears. Then I can come back to the original task I had in mind.
    Can you advise how to fix it so that the ribbon always appear when loading a list?
    Thanks a lot.

    Thanks dear Alex,
    Probably... I am not the programmer, but the user. The programmer told me that it was impossible to have the ribbon available unless an item of the list is clicked on first, so I wanted to investigate if that is true and if there is a way around it. Does
    not seem natural to have to open an item on the list before creating a new one.

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

  • How to raise mail notification when ever the new event is added to calendar list in sharepoint 2010?

    Hi experts, I need guidance or the way how we can raise mail,
    When ever the new item is added / updated / deleted / cancelled to a calendar list in SharePoint 2010.
    Shall we achieve it through using SharePoint designer 2010.
    If its help to fix the requirement.
    Thanks and Regards,
    Dhayanand Kalimidi

    >I need to send the mail before 1 week from the date
    This is different requirement. Initially you said you want send email when item is added / updated / deleted in list. For this you can use default alert to send instant email as  suggested before. 
    Now if you want to send reminder email then you can use designer WF and calculate the due date by using variable. Refer this link for your ref:
    http://mysharepointchronicles.wordpress.com/2012/11/05/sharepoint-list-with-workflow-email-reminder-set-to-send-30-days-from-created-date/
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/3211ee00-92de-47f1-b611-4c9609f92ab7/how-do-i-set-sharepoint-2010-to-send-a-reminder-email-a-month-after-a-date-already-listed?forum=sharepointdevelopmentlegacy
    Remember event receiver can not send reminder email or scheduled email so for this either use designer WF or create timer job.
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to create a custom Contacts list in SharePoint 2010 from accounts already in AD

    Hi folks,
    Newbie to SharePoint but not to being an Administrator.  Problem is that in my new functions I no longer am an Admin.
    I have been asked to post contact lists (Excel) on the SharePoint site.  (fairly easy to do)
    But I though....we already have these people in AD and the GAL
    Why can't I just import what I want only and display that in SharePoint.
    I assume this is possible?
    I do not have SharePoint designer nor any programming experience....so no coding for me.
    Running SharePoint 2010 and Outlook 2010
    Can anyone guide me or give me info on how to do this?
    I do not want everyone in the AD/GAL.  Just some specific names with their contact info

    Hi,
    Please check this
    http://beyondweblogs.com/update-user-profile-in-sharepoint-programmatically/

  • Custom SharePoint 2010 designer page throws "The data source control failed to execute the insert command" exception while adding the new item after the August 13, 2013 CU has installed

    We have the SharePoint Server 2010 with SP1 environment on which the custom SP2010 designer pages were working as expected before the
    August 13, 2013 CU has installed. But, getting the below exception while trying to add the new item after the CU has installed.
    Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteInsert(IDictionary values)     at
    System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    06/19/2014 16:49:37.65  w3wp.exe (0x1240)                        0x1300 SharePoint Foundation        
     Runtime                        tkau Unexpected Microsoft.SharePoint.WebPartPages.DataFormWebPartException: The data source control
    failed to execute the insert command. 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.InsertCallback(Int32 affectedRecords, Exception ex)     at System.Web.UI.DataSourceView.Insert(IDictionary
    values, DataSourceViewOperationCallback callback)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.FlatCommit()     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.HandleOnSave(Object sender, EventArgs e)    
    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean
    inclu... 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    06/19/2014 16:49:37.65* w3wp.exe (0x1240)                        0x1300 SharePoint Foundation        
     Runtime                        tkau Unexpected ...deStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    I have tried changing the "DataSourceMode" as below, now the insert command is working, but update command is not working.
    <SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" />
    Also, the lookup dropdown fields are displaying the value as "<a href="Daughterhttp://cpsp10/sites/Employees/_layouts/listform.aspx?PageType=4&ListId={8F62F444-FB6A-4F03-9522-C4696B45DCD1}&ID=10&RootFolder=*">Daughter</a>"
    instead of only "Daughter".
    Please provide the solution to get rid of this issue.
    Thanks
    Ramasubbu

    Try below:
    http://social.technet.microsoft.com/Forums/en-US/ae910269-3a0c-4506-844b-e8bc89d95b71/data-source-control-failed-to-execute-the-insert-command
    http://blog.jussipalo.com/2012/01/sharepoint-2010-data-source-control.html
    While there can be many causes for this generic error message, in my case the first parameter or ddwrt:DataBind function inside the SharePoint:FormFields element was
    'i' and I was working with an Edit Form. Changing it to
    'u' as it was with every other FormField fixed the issue.
    <SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Esittaja" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Esittaja')}"
    />
    Explanation:
    DataBind operation type parameters (the first parameter) are listed below:
    'i' stands for INSERT,
    'u' stands for UPDATE,
    'd' stands for DELETE.
    http://webcache.googleusercontent.com/search?q=cache:d9HHY4I7omgJ:thearkfloats.blogspot.com/2014/03/sharepoint-2010-data-source-control.html+&cd=4&hl=en&ct=clnk&gl=in
    If this helped you resolve your issue, please mark it Answered

  • Multiple filters in a drop-down list in SharePoint 2010 browser forms

    I am using Infopath forms based on SharePoint 2010 lists. I am trying to filter a drop-down control based on inputs in two previous controls such that it looks up information in a list and returns options where A = A and B = B. This filter works when using
    Preview in Infopath 2010, but does not work on the list itself on publishing; it only filters where A = A. The B = B filter is ignored.
    1) Is there a workaround I can use so that the browser form respects the filter in the same way the Infopath form does?
    or, if not:
    2) Is there a way to force SharePoint 2010 to open up "new item" or "edit item" in InfoPath instead of in a browser form?
    Thanks.

    Thanks for your help!
    1) That was my concern. When I googled around, it seemed like it wasn't possible to do filters at all in DLL in browser forms, yet I had one that was working. So I was curious why one worked but two didn't.
    2) When I try to publish an InfoPath form from Designer that's based on a SharePoint list, the only option it gives me is to publish to that list, not to a document library.
    2a) If I did figure out how to do it, would it still submit the information to the list? I don't want a form library scenario where each list item is its own form based on a single template, I want a list I can also manage with Access.

  • Validation settings for a list in Sharepoint 2010 to find if there is a document attached to the list item

    Hi Everyone,
    Greetings!!!
    I have a very peculiar question on List validation settings. I want to validate a list item whether user has attached a document to the list item or not? The list item should not be saved until a document is attached to it. Is it possible to perform this
    validation for a list item in a list?
    Please let me know.
    Thanks,
    Thiru
    Tirumal

    Can be done using java script as below
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c93d7611-f634-4c03-ae0d-3b5ecfe5ca6a/how-to-make-attachment-required-field?forum=sharepointadminlegacy
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/5a3fe11a-75ea-44bd-aab9-80817640290f/how-to-make-an-attachment-required-field-in-a-custom-newform-sharepoint-2010-list?forum=sharepointcustomizationprevious
    Dont think below is right
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/fba48bc1-8708-401c-8a37-bc00f77eeae3/making-attachments-required-in-a-custom-list?forum=sharepointadminlegacy

  • How to Archive a list in sharepoint 2010

    Hi
    I think large list is the inevitable trend and will be a very common issue faced by everyone. We are a medium business using sharepoint 2010.
    For past 3 years, one of our SharePoint lists is over 20000 items.
    From my end:
    1.     I have indexed some important columns and created filtered views but it does not help much.
    2. I have increased the list threshold value to 25000( Even though the best practice is 5000).
    3. Also,  I have set the list template size to 500MB 
    4.     When I try to save the list as a template,  SharePoint throws an exception error.  
    5.   I tried working on the code
    mentioned in the link
    below but it looks complicated for me.
    http://spboom.com/sharepoint-development/moving-sharepoint-list-items-to-archive-list/
    What I need:
    I need to archive old items in the list.  After archiving,  I might need to refer to the archived items from time to time.
    As I'm newbie to SharePoint, it would be great, if someone can elaborate in detail with what can be done.
    Again your help in this is much appreciated.
    Thanks & Regards,
    SweR

    What vesion of SharePoint are you using?  If you want to move items across from one list to another (as per your prefered option), something like: -
    Create a list template of you list with no content
    Recreate it on the same level as the main lis
    Create an SPD workflowthat'll copy an item to the new list and delete the original.  Make sure it doesn't have a triggering action
    Use an Expiration Information Rights Policy to triger the workflow. 
    Please note that this won't preserve the original author / create metadata as Alex has already said.
    Cheers,
    Steven Andrews
    SharePoint Business Analyst
    Blog:
    Steve's SharePoint Space  Twitter:
      LinkedIn:
      Facebook:
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Cannot create list in SharePoint 2010 using Client Object Model

    I am trying to utilize SharePoint 2010 Client Object Model to create a List based on a custom template. Here's my code:
    public void MakeList(string title, string listTemplateGUID, int localeIdentifier)
    string message;
    string listUrl;
    List newList;
    Guid template;
    ListCreationInformation listInfo;
    Microsoft.SharePoint.Client.ListCollection lists;
    try
    listUrl = title.Replace(spaceChar, string.Empty);
    template = GetListTemplate((uint)localeIdentifier, listTemplateGUID);
    listInfo = new ListCreationInformation();
    listInfo.Url = listUrl;
    listInfo.Title = title;
    listInfo.Description = string.Empty;
    listInfo.TemplateFeatureId = template;
    listInfo.QuickLaunchOption = QuickLaunchOptions.On;
    clientContext.Load(site);
    clientContext.ExecuteQuery();
    lists = site.Lists;
    clientContext.Load(lists);
    clientContext.ExecuteQuery();
    newList = lists.Add(listInfo);
    clientContext.ExecuteQuery();
    catch (ServerException ex)
    Now, this particular part, newList = lists.Add(listInfo); clientContext.ExecuteQuery();, the one that is supposed to create the actual list, throws an exception:
    Message: Cannot complete this action. Please try again.
    ServerErrorCode: 2130239231
    ServerErrorTypeName: Microsoft.SharePoint.SPException
    Could anyone please help me realize what am I doing wrong? Thanks.

    I've made progress - well, at least to some extent. The previous message related to the "Invalid file name" is not appearing any more. I now realize that it is necessary to specify feature ID, list template kind, as well as custom schema in order
    to order SharePoint 2010 to create the document library. 
    However, there's a new problem which isn't documented on the net almost at all (at least I was unable to find anything): The document library gets created, but I cannot access it. Further inspection showed that the doc lib views are not created. Basically,
    the only accessible doc lib page is the document library settings page. Also, I get the server exception with the message: 
    Server Out Of Memory. There is no memory on the server to run your program. Please contact your administrator with this problem.
    Any idea what is causing this issue? Thanks. 
    Hi Boris
    Borenović,
    I think I found the reason for this notorious "Server Out Of Memory" error.
    (Man, it took 4 hrs of frustrating troubleshooting without any direct hints... very disappointing
    MSFT developers :( ).
    Anyway,
    All the "Form" elements at the bottom need to have SetupPath="pages\form.aspx"
    attribute (by default this attrib is missing when you copy the whole List element from inside the stp's manifest.xml  file).
    Also, just make sure that each "View" element has correct "WebPartZoneID", "SetupPath" and "Url" attribute values otherwise that list/library will
    be created successfully but will fail to load when you try to access it (with the VERY helpful "Cannot complete this action, contact administrator" error). Even if you enable stack trace (or check ULS logs) you will find "An unexpected
    error has been encountered in this Web Part.  Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." and you will never realize it's because of the
    incorrect attributes ("WebPartZoneID", "SetupPath" or "Url" as mentioned above).
    Come on Microsoft, you can do better than that?
    If the API needs this attrib then why is it missing inside the manifest.xml file when
    an STP file generated in the first place?

  • How to Get current username in custom SharePoint 2010 master page

    Hi,
    How can I get current logged-in username in SharePoint 2010 custom master page?
    Regards,
    Amit

    You can use the SPContext.Web.CurrentUser object to get at the information you're looking for. This can be accessed either via client-side JavaScript or server-side ASP.NET code.
    Getting the logged in user's login and name via JavaScript:
    <script>
    ExecuteOrDelayUntilScriptLoaded(function(){
    var clientContext = SP.ClientContext.get_current();
    var CurrentUser = clientContext.get_web().get_currentUser();
    clientContext.load(CurrentUser);
    clientContext.executeQueryAsync(Function.createDelegate(this,function(){
    // User's Name
    alert(CurrentUser.get_title());
    // User's Login
    alert(CurrentUser.get_loginName());
    }),Function.createDelegate(this,function(sender,args){alert(args.get_message())}));
    },"SP.JS");
    </script>
    And of course, it's even easier via server-side C#:
    <script runat="server">
    String username = SPContext.Current.Web.CurrentUser.Name;
    String userlogin = SPContext.Current.Web.CurrentUser.LoginName;
    </script>
    I hope that helps!

  • Rich text toolbar missing on a survey list in Sharepoint 2010

    Hi , 
    I created a Survey list in SP 2010 and added a 'Content Editor' webpart to it. The problem is that there is
    no Ribbon available in the Survey List in SP 2010. (While it is available in the a normal list) Why? Is it the default functionality of Sharepoint 2010?
    How can I add a rich text toolbar so that while editing the content webpart I can format the text. Is it possible?

    Hi Yasir,
    This behavior is by design. When you add a content editor web part on survey list page, you can only add the plain text.
    Have a try to add a rich text control
     InputFormTextBox to the overview.aspx page in SharePoint Designer, add the following code to code behind.
    <SharePoint:InputFormTextBoxRows="10"MaxLength="1000"id="txtMyRichTextBox"runat="server"RichText="true"RichTextMode="FullHtml"TextMode="MultiLine"
    Height="400px"Width="250px"></SharePoint:InputFormTextBox>
    For more information, see
    http://blog.mastykarz.nl/rich-text-editor-control-sharepoint-2010/
    Best Regards.
    Kelly Chen
    TechNet Community Support

Maybe you are looking for

  • Footer in the table control?

    hi, How do i display the footer in the table control (which allows me to browse the table page by page)? rgds, ram

  • "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition

    I am creating a program in Java which has a Database reference application.The Database I am using is MS Access.But whenever I am trying to run the program from DOS Prompt(ie executing the program:java <program name>) I am unable to connenct to the d

  • Running a WD-Appl. results in 500   Internal Server Error

    Dear all, I installed both JAVA and ABAP stack (Sneak preview 6.40 SP15) on one box. In the NSP I created a Web Service via SE37 using an existing RFC function module of my own. Then I released my Web Service for SOAP Runtime via WSCONFIG. Next I che

  • MobileMe/IMAP: locally stored messages disappeared

    Hi, with the current service window of MobileMe, I cannot access my e-mails via the web interface. Fair enough, I thought, I was looking for a message I sent yesterday, and this will surely be accessible through Mail or at least in my local IMAP dire

  • IMac won't start

    My 2007 iMac [10.6.8] has been getting slower and slower to start, ultimately taking two hours on the rare times I did it until now when it just stuck on the grey Apple screen. The disk is OK, in Target mode and using Disk Utils from my MacBook Pro,