Thursday, December 17, 2020

Login failed for user when connecting to Azure SQL

Problem:  When using dotnet ef database update to create database schema for Azure SQL DB. Errored out with below (Login failed for user). But no problem logging in from Managemnet Studio using same credential. Username and password are in connection string as test.

 try, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)Error Number:18456,State:1,Class:14
Login failed for user 'xxxx'.

Issue: Seems for some reason the command not able to handle special character in password (with special characters in connection string. 

Resolution: Updated the admin password without special characters and it worked fine (You can do so easily with powershell or on Azure admin UI). There were suggestions to escape them with backlash or quote etc,none worked for me so far. Idea?

Monday, December 14, 2020

npm install gulp yo @microsoft/generator-sharepoint error

Problem:
Errors when trying to install SharePoint with npm install gulp yo @microsoft/generator-sharepoint.   It errors out like below
npm ERR! code EEXIST
npm ERR! path C:\Users\XX\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
npm ERR! dest C:\Users\XXX\AppData\Roaming\npm\gulp.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\xxxn\AppData\Roaming\npm\node_modules\gulp\xxx\gulp.js' -> 'C:\Users\xxx\AppData\Roaming\npm\gulp.cmd'
npm ERR! File exists: C:\Users\xxx\AppData\Roaming\npm\gulp.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2020-12-14T19_15_00_552Z-debug.log

Cause: There may be a newer version of gulp and npm is not able to replace.  This command works with certain version only.
Resolution: Remove the npm folder and re install.  Everything is good after that.
There must be other way to pin point exactly what is needed but this seems to be quick fix.

Wednesday, December 10, 2014

RowLimit error says range can only be set to 500 maxinum. But doesn't seem to have any effect in return result.

In SharePoint 2013, based on my experiment/testing: RowLimit setting has no effect on result returned when TotalRowsExactMinimum is set to large nubmer. It has impact when TotalRowsExactMinimum is set to be smaller than total results.

But it seems StartRow is honored for all the cases. Without setting rowlimit. Result is able to return more than 500 results.

When trying to set Keywordquery's RowLimit to large number you will get exception

"RowLimit - The allowed range of values is 0 to 500"

What happens is MaxRowLimit on that application defaults to 500 and that value is passed to the query. RowLimit can't be set to be larger than MaxRowLimit,which is set at search service application level.

The SearchServiceApplication MaxRowLimit can be modified as follows:

PS> $ssa = Get-SPEnterpriseSearchServiceApplication
PS> $ssa.MaxRowLimit = 1000
PS> $ssa.Update()



The server was unable to save the form at this time. Please try again

Problem: You may periodically encounter some errors like below when trying to perform a search in SharePoint:

"The server was unable to save the form at this time. Please try again"
 "Search has encountered a problem that prevents results from being returned."

Solution: Stopping and starting the 'SharePoint Search Host Controller' service.

This solves the issue most of the time. There are times it doesn't. More post to follow on this.

Asp.net/SharePoint button Click event fires only once

Problem: Response.end and download file problem using asp.net code inside SharePoint. Button click event fires only once when it is first clicked. After that,button no longer respond to click event.

Solution: Insert below script block.
function enablePostBack()
{ window.WebForm_OnSubmit = function () { return true; }; }

button.Onclientclick="enablePostBack";

Friday, September 28, 2012

summary links web parts becomes form content webpart

Experienced a strange issue where Summary Links webpart turned into form content webpart on sharepoint 2010. The page has been modified by multiple people and was able to restore to old version but unsure how it happened.

Thursday, September 13, 2012

summary links webpart,can not remove links.

As site collection admin,I removed a link and when I saved the change the link reappeared.but when I tried to edit it was not there.
I logged in as a different user and the link was there.I was able to remove it. Still unsure of the reason