caml query not returning selected value from choice field : so an inverse select ex: if you want to get which are yes or true make it not equal to no or false . NEQ --> no or false of that field <Neq><FieldRef Name='filename' /><Value Type='Boolean'>No</Value></Neq>
Posts
Showing posts from 2014
- Get link
- X
- Other Apps
Filter results from a data table c# ex: get unique values of a coloumn , DataView view1 = new DataView(datatable1); distinctValues1 = view1.ToTable(true, "user"); DataRow[] values1 = distinctValues1.Select(" "); int numberofitems= values1.Count(); //this gives you count of unique rows you can access info of that unique rows from values1 array .
- Get link
- X
- Other Apps
.net console application execute as differnet user : or .net read file as a different user etc : using (UserImpersonation user = new UserImpersonation(uname, Domain, pass)) { if (user.ImpersonateValidUser()) { //write your code to read file or access items etc .. } } wehn you run the code you can see if you are successful to login as that user or not .if you are logged it it show old user and impersonating user details . right click on U serImpersonation: and select generate a class : ADD THIS CODE TO THAT GENERATED CLASS FILE : make sure you add inherit from idisposable . class UserImpersonation: IDisposable { [DllImport("adva...
- Get link
- X
- Other Apps
Solved :Workflow dosent send task email . Solution: Gnereally such issues occurs whne there is a patch applied on sharepoint server . Such error is caused due to workflow access denied to keys in hive folder / registry keys . if you look at your ULS logs you should see Access denied when you start a workflow. To fix this issue you should either go with running configuration wizard on farm from central admin or . you can use powershell command to grant access to keys . The Initialize-SPResourceSecurity cmdlet enforces resource security on the local server. This cmdlet enforces security for all resources, including files, folders, and registry keys.
- Get link
- X
- Other Apps
C# random number generator returns same number . or reandom number c# returning same number . Solution: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace msdn { class Program { private static readonly Random random = new Random(); private static readonly object syncLock = new object(); static void Main(string[] args) { const int numInt = 3; int[] Test = new int[numInt]; for(int i=0; i<numInt; i++) { Test[i] = randNum(numInt); } foreach(int num in Test) ...
- Get link
- X
- Other Apps
Fixed the issue: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM' Solution: Make this change to your binding in web.config file <binding name=" BasicHttpBinding_ISPWebUsage2 "> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> Also make sure you have the same binding in endpoint <client> <endpoint address="http://abcdefgh/_vti_bin/service1/service.svc" bin...
- Get link
- X
- Other Apps
SharePoint 2013 REST service Basics : SharePoint 2013 introduces a Representational State Transfer (REST) service that is comparable to the existing SharePoint client object models. Now, developers can interact remotely with SharePoint data by using any technology that supports REST web requests. This means that developers can perform Create, Read, Update, and Delete (CRUD) operations from their apps for SharePoint, solutions, and client applications, using REST web technologies and standard Open Data Protocol (OData) syntax. how it works : To access SharePoint resources using REST, construct a RESTful HTTP request, using the Open Data Protocol (OData) standard, which corresponds to the desired client object model API. Client object model method: List.GetByTitle(listname) REST endpoint: http://server/site/_api/lists/getbytitle('listname') The (client.svc in 2010) renamed as (_api in 2013 sharepoint ) web service in SharePoint handles the HTTP request, and serv...
- Get link
- X
- Other Apps
Progamatically iterate throught discussion board and read post ,replies CSOM (client side object model ) code: Get all posts : ClientContext ctx = new ClientContext("http://h8.net/sites/abcd"); //Get the Discussion list List lst = ctx.Web.Lists.GetByTitle("Discussions List"); //Get the topics in the list CamlQuery q = CamlQuery.CreateAllFoldersQuery(); ListItemCollection topics = lst.GetItems(q); ctx.Load(topics); ctx.ExecuteQuery(); Get repiles: //Select a topic from topic array . its in decending order the oldest is 0 ListItem topic = topics[0]; //Get the replies of the selected topic q = CamlQuery.CreateAllItemsQuery(100, "Title", "FileRef", "Body"); //FileRef contains the site relative path to the folder q.FolderServerRelativeUrl = topic["FileRef"].ToString(); ListItemCollection replies = lst.GetItems(q); ctx.Load(replies); ctx.ExecuteQuery(); Create Discussion ites: ClientContext ctx = new ClientContext("htt...
- Get link
- X
- Other Apps
Issue with multiple Picture Slideshow WebPart on same page SharePoint 201 Answer: sharepoint 2013 dosent support multiple slideshow webparts on same page . Lets hope microsoft would provide a fix for that . Trial: When you try to do that you will see both the webparts will point to only one picture library even if you change them to diffrent sources .So you will see same pictures scrolling in both the webparts .
- Get link
- X
- Other Apps
GridView must be placed inside a form tag with runat=“server” even after the GridView is within a form tag Solution : You are calling GridView.RenderControl(htmlTextWriter), hence the page raises an exception that a Server-Control was rendered outside of a Form. add this code public override void VerifyRenderingInServerForm(Control control) { return; }
- Get link
- X
- Other Apps
Metalogix Exception thrown: Server was unable to process request. ---> Exception from HRESULT: 0x80131904 ---> Exception from HRESULT: 0x80131904 Solution: Check for sql server space . Check if you content db is out of space. Check if the cache of sql is cleared . Check if the read and write permissions are allowed on this sql db .
- Get link
- X
- Other Apps
Sharepoint 2013 Get Items from a list CSOM : Soltion : using (ClientContext ctx = new ClientContext("https://xyz/sites/abc")) { Web web = ctx.Web; List list = web.Lists.GetById(new Guid("12345-56655-2sdfgsrg-345235-23ddcs444")); var q = new CamlQuery() { ViewXml = "<View><Query><Where><IsNotNull><FieldRef Name='ID' /></IsNotNull></Where></Query></View>"}; var r = list.GetItems(q); ctx.Load(r); ctx.ExecuteQuery(); } in the above example we are retiving list values where id is not null . After retriving the list values you can assign this var type result to ineumerable to perform linq or any other data formating,filtering operations EX: IEnumerable<ListItem> lc = r.ToList();
- Get link
- X
- Other Apps
How to Get column item from ienumerable list Solution: IEnumerable<ListItem> lc = r.ToList(); var Items = (from p in lc where (p["Issue_x0020_Type"].ToString().Trim()) == "Closed" group p by DateTime.Parse( p["Create_x0020_Date"].ToString() ).Month into g select new { month = g.Key, count = g.Count...
- Get link
- X
- Other Apps
LINQ get items count by month from list Solution : var ItemsDetails = (from p in lc where (p["Issue_x0020_Type"].ToString().Trim()) == "Open" group p by DateTime.Parse(p["Create_x0020_Date"].ToString()).Month into g select new { month = g.Key, count = g.Count() }); Access items Linq with for loop . foreach (var listItem in...
- Get link
- X
- Other Apps
Metalogix sql error:40 network error . Solution: That connection error is caused by either: 1) Content Matrix not being able able to locate the SQL Server on the network (try to ping the SQL Server by name to verify name resolution). 2) Permissions. The account being used to connect must have minimum Read access to the source content database. retry your connection.
- Get link
- X
- Other Apps
Metalogix : Exception thrown: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown. Solution : check your app pool of webfrontend . restar iis and it will free up th pool and metalogics can communivcate with sharepoint . \restart iis from cmd prompt with command : IISReset
- Get link
- X
- Other Apps
the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine solution ) install missing files . 1: http://www.microsoft.com/download/en/details.aspx?id=13255 download and install this: http://www.microsoft.com/download/en/confirmation.aspx?id=23734 open in visual studio and follow the wizard
- Get link
- X
- Other Apps
UnInstall App from sharepoint 2013 You can do it from UI by : Site content --> click on ... of aqpp and you will see remove . click on remove and it should work . If it says refresh page and try again try it and if you are still not able to do it just try powershell command below it will do the magic for you . from powershell: $instances = Get-SPAppInstance -Web http:/sharepointsite:1234/sites/test1 $instance = $instances | where {$_.Title -eq 'App1'} Uninstall-SPAppInstance -Identity $instance
- Get link
- X
- Other Apps
Sharepoint on adding a list /any action. Sorry, something went wrong Additions to this Web site have been blocked. Please contact the administrator to resolve this problem. solution: Unlock the site through central admin. application managment . site collections. configure quotas and locks select site collection and select radio button not locked . and your site should be good to go. central admin or powershell Set - SPSite http : //SiteCollectionUrl -LockState Unlock
- Get link
- X
- Other Apps
The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm. Solution: Cause: Your login user has no 'db_owner' access for SharePoint Databases. 1. SharePoint_Config 2. SharePoint_AdminContent_[XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX] 3.Your web application DB in which you want to deploy WSP (Example. WSS_Content_XXXX) Solution: Now connect your SQL Server with admin user. Then select your user which has error in deployment.
- Get link
- X
- Other Apps
Delete a subsite sharepoint 2013 Use this procedure to delete a subsite. After completing this procedure, the selected subsite including all document libraries, lists and list data, Web Parts, site settings, and configuration applied for that site is deleted. Delete a subsite Open the parent site by using any one of the following methods: Type the URL of the site in the Internet Explorer. On the View Site Collection page, click the site collection that you want to view. Click Site Actions , and then click Site Settings . The Site Settings page appears. In the Site Administration section, click Sites and workspaces . The Sites and Workspaces page lists all subsites that are available in the parent site in a table. Click the delete icon corresponding to the subsite that you want to delete. The Delete This Site page displays a message to confirm the deletion of the site. Click Delete . A message appears to confirm that...
- Get link
- X
- Other Apps
Sharepoint 2013 ADD CHOICE to sharepoint list Programatically CSOM . CODE: baseUrl = "http://sharepointsite:1234/sites/abcd"; context = new ClientContext(baseUrl); network = context.Web; List People = network.Lists.GetByTitle("List Name"); Field f = People.Fields.AddFieldAsXml("<Field Type='Choice' DisplayName='col name ' Name='col name ' Format='Dropdown' Required='TRUE' Indexed='TRUE'><CHOICES><CHOICE>A</CHOICE><CHOICE>B</CHOICE><CHOICE>C</CHOICE></CHOICES><Default>A</Default><Description>choices </Description></Field>", false, AddFieldOptions.DefaultValue); ...
- Get link
- X
- Other Apps
DELETE A VIEW from sharepoint list Programatically Sharepoint 2013 try { baseUrl = "http://sharepointsite:1224:/sites/mysite"; ; context = new ClientContext(baseUrl); network = context.Web; List sd = network.Lists.GetByTitle(" xyz "); Microsoft.SharePoint.Client.View approveRejectView = sd.Views.GetByTitle("view1"); approveRejectView.DeleteObject(); context.ExecuteQuery(); ...
- Get link
- X
- Other Apps
Sharepoint 2013,2010 Change LIST COLUMN to Required Field CSOM . Solution: Marking abcd column in xyz list as required try { baseUrl = "http://sharepointsite:1224:/sites/mysite"; context = new ClientContext(baseUrl); network = context.Web; List People = network.Lists.GetByTitle("xyz"); Field f1 = People.Fields.GetByTitle("abcd"); context.Load(f1); context.ExecuteQuery(); ...
- Get link
- X
- Other Apps
Listing All SharePoint Server 2013 Features – Including Name, Title, Scope, ID and Description At times while working with SharePoint I need a reference table which can provide basic details of all the out of the box features that available as part SharePoint Server 2013 installation. For some reason I didn't manage to find documentation around that online so I decided to generate it myself. I used PS to generate a csv file (Features.csv) which contains DisplayName, Title, Scope, ID and Description of all the available features in SharePoint. Once csv is generated then I import it into a Excel sheet to do a bit of formatting to generate the table below. The PS is really simple and use "*" as a delimiter. The reason of using asterisk is due to the fact that comma and semicolon are used within title and description of some of the features. I also use LCID of 1033 (English) because that was the locale for my installation of SharePoint Server 2013. $lcid=1033 $d...