Posts

Fixed "String was not recognized as a valid DateTime" error in SharePoint 2013 when date is valid

I met the issue "String was not recognised as a valid DateTime" when I executed the code which using " DateTime.Parse(strdate)" to convert the string value with date format "01/03/2016" (Australian date format) in a SharePoint 2013 site.  The code is executed successfully in another SharePoint environment, and so I verify the "Regional settings" in this SharePoint site, and found out the "Time zone" settings is correct which set to "Sydney" time zone and the "Locale" settings was set to "English (United States)" which is incorrect, and so I change the "Locale" settings to "English (Australia)". I refresh the WebPart Page again, and the issue was gone!

SharePoint 2013 error - "Application error when access /_vti_bin/client.svc"

I had been received a error message " Application error when access /_vti_bin/client.svc, Error=Path '/_vti_bin/client.svc/ProcessQuery' is forbidden " when try to add user account to a user group in SharePoint 2013 Portal . I searched the issue in google and found out it may related to security issue in local folder  "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI" of " /_vti_bin/client.svc ". I verified the user permission on this folder and found out that "IUSR" for IIS is not there, and so I granted user account "IUSR" read and execute permission in this folder. I went back to try add user account in SharePoint again, and it worked successfully this time! This issue is related to error "The server was unable to save the form at this time. Please try again." which can be resolved using above configuration. In addition, if this error still occur, check the windows features in con...

Fixed "the microsoft ace oledb 12.0 provider is not registered" error when import data from Excel spreadsheet in SQL Server 2012

I try to import a Excel 2013 spreadsheet to SQL Server 2012 Database and received above error message. I installed below component "2007 Office System Driver: Data Connectivity Components" (https://www.microsoft.com/en-us/download/details.aspx?id=23734) and then try the import again. Works fine!

Using native Facebook App's authentication to login to Azure Mobileservice in Universal Windows App

I used the "Facebook authentication" in Azure Mobile App service but it requires user to enter Facebook credential to login by default, and so I need to get the user token from native Facebook app and then pass it to Azure App service.  Below is the code I used to retrieve user token from native Facebook app. It will redirect user to native Facebook App to authenticate. string fbAppId = "xxxxxxxxxx"; string fbWinAppId = "xxxxxxxxxxxxx"; string FacebookURL = "https://www.facebook.com/v2.7/dialog/oauth?client_id=" + fbAppId; string callBackURL = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().AbsoluteUri; string token = string.Empty; FacebookURL += "&redirect_uri=" + System.Uri.EscapeDataString(callBackURL) + "&display=popup&response_type=token&state=1&scope=email";  System.Uri startURI = new Uri(FacebookURL);  System.Uri endURI = new Uri(callBackURL);  var resultFB = await  Windows.Sec...

Fixed "String was not recognized as a valid DateTime." issue in SharePoint 2013

Image
I met the issue "String was not recognized as a valid DateTime." in a WebPart in SharePoint 2013 site. The issue was occur in a line of code: DateTime.Parse(dr["DUE_DATE"].ToString());   The code works fine in production environment and I verified the date format for "dr["DUE_DATE"].ToString()" was "10/03/2016" (Australian Date format).  I went to "Site settings"-> "Regional settings" and then changed the "Locale" drop down list to "English (Australia)" as below screenshot. Now the issue is gone and the Date time value is showing in the WebPart! 

Calling a external web service in a SharePoint 2013 WebPart

I need to call a external web service in SharePoint 2013 WebPart. The web service URL is "http://abr.business.gov.au/abrxmlsearchRPC/AbrXmlSearch.asmx". I created a ASP.NET web application to test the functionality firstly. I added a server reference as a Web reference for this web service and then using the web service call but received the "Unable connect to remote server" error. I changed to use "HttpWebRequest" e.g. HttpWebRequest request = (HttpWebRequest)WebRequest.Create("<service url>"); and then add a "webproxy" class as below: WebProxy webProxy = new WebProxy("<proxy url>");   Set the HttpWebRequest to use above proxy request.Proxy = webProxy; But I retrieved the "HTTP 401 Not Found" error message when try to get the response: response=((HttpWebResponse)(webRequest.GetResponse()));   So I decided to use default system proxy as below: request.Proxy = WebRequest.GetSystemWebProxy...