Saturday, 26 June 2021

Error "The specifed resource name contains invalid characters" while creating blob using BlobContainerClient

 

You may face the following error while creating blob using the BlockContainerClient, though the error is a bit mis-leading and this could happen because of upper case characters as well in the name of the blob. 

So please ensure that you don't have any upper case characters as well along with the special characters while creating the blob.





Friday, 7 March 2014

NULL Value Identity Provider - While connecting Dynamics CRM 2011 online



When you receive an NULL - Identity provider value while connecting CRM online through online federated authentication, it is due to the default user that you using to connect to CRM. Create a new user in CRM and provide valid rights to that user and then try to connect using that user. It Works.

 

Monday, 23 December 2013

This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. - MVC


MVC by default does not allow the methods to be fetched directly which does return a JSON result due to security reasons. Request behavior shall be marked explicitly to allow to do a get operation.

return Json(data, JsonRequestBehavior.AllowGet)

Once you add this "JsonRequestBehavior.AllowGetOn" it allows to do a get operation to return the JSON result to browser.
 

Unable to load the specified metadata resource entity framework - Entity Framework


Few days before I have encountered the error "Unable to load the specified metadata resource entity framework" while loading the application. After changing the connecting string from as defined below my problem got sorted out.

From

connectionString="metadata=res://*/Data.System.csdl|res://*/Data.System.ssdl|res://*/Data.System.msl";

To

connectionString="metadata=res://*/;<remainingpart>

Thursday, 19 December 2013

The ViewData item that has the key '' is of type 'System.Int32' but must be of type 'IEnumerable'. - MVC



Some times you end up with this error in MVC saying "
The ViewData item that has the key ''is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>'."
 
There are 2 possible reasons that this could happen.
 
One is that if you have a view where you are displaying a dropdownlist but you are not returning a list to it and it tries to read the Id value from your entity and it says that it is expecting a list and what you returning is not a list.
 
So probably you resend the data by converting to .ToList()
 
Second scenario would be you have do a create operation and forget it to redirect to index page and being in the same page again and if you don't fill your view bag again with that dropdownlist value that you populating then it would throw that error back.

Wednesday, 18 December 2013

"The model item passed into the dictionary is of type 'System.Data.Entity.Infrastructure.DbQuery`1[System.Boolean]', but this dictionary requires a model item of type -" ASP.Net MVC


The model item passed into the dictionary is of type 'System.Data.Entity.Infrastructure.DbQuery`1[System.Boolean]', but this dictionary requires a model item of type

 

This error would appear when the Controller return the result which is not of type that View is expecting if your view is tightly bound with the model.

Also note that whether you returning a single item of object or returning a collection, even though you return the same object if it is a collection then it would throw back this error.

 

"Cannot open serverrequested by the login. Client with IP address is not allowed to access the server" while accessing SQL Azure



When you are using SQL Azure Database you may end up with this error ""Cannot open server requested by the login. Client with IP address is not allowed to access the server" at time development. This is due to because you Azure firewall settings does not allow you system to access the sql server as it is not been listed as permitted IPs . To do the following you can login to windows azure and select your database and choose the menu option dashboard as show below.


You can click on manage and it does automatically reads your IP and prompts to add that in the permitted IP list as shown below.

Once you say OK now you are good to go and access your database from your development environment.