“A SharePoint database named ‘….. ‘already exists. You must supply another name for the new database.” – Using Sql Server BackUp and Restore of Content Database.


To create a new web application which will use an existing content database we need to do the following.

Open Sql Server Management Studio

To take back up of the database in my case it was ‘WSS_Content_fa5cc7a0686e424bbe4fc128b4a48cf4’

Right click the database select tasks select Offlinethen select Detach.

Get the mdf and ldf file for the database.

Attach the files and create a new database.

Now to Central Administration Site Application Management Create a new web application

Let the name of the database as default.

Now go to Content Database within Application Management Select the web application just created.

Click on the Database Name Select Database Status as Offline and Check Remove Content database check box.

Now click on Add Content Database In the Database Name specify the name of the new restored database.

This is the point we can get this error “A SharePoint database named ‘….. ‘already exists. You must supply another name for the new database”

The solution for this is to go to

SharePoint_Config database There run this query

delete from Objects where name=’name of restored db’;


Bye

0x80040220 SecLib::CrmCheckPrivilege failed. Returned hr = -2147220960 on UserId: dd80d8b7-6700-dd11-9838-001185e68627 and PrivilegeId: 0b609bc5-afb0-4576-8db0-7ad715375833 Platform


Hi,

We upgraded from CRM 3 to CRM 4, and certain users got this error while trying to access the CRM.

We realized that the users receiving this error had our own custom security role assigned to them. i.e System Primer.

When we assigned them any of the existing default security role there was no problem in accessing the CRM.

So the way we resolved was to assign a default security role and our own custom role to the user, so that he could access the system for the first time without any issues and

after the user has accessed it once than we removed the default security role.

This approach worked for us!!!!

Or another thing that worked was if we are assigning any custom role to users, we gave the write permission for user settings in that custom role.

the kb article for this error are

http://support.microsoft.com/kb/953962/en-us

http://support.microsoft.com/kb/952279/en-us

Bye

Consuming an Asp.NET web service using SOAP protocol from JavaScript


There are many ways we can consume a web service
The three common protocols for accessing a .NET web service are
HTTP GET, HTTP POST and SOAP.
The trasport protocol used for them is HTTP. However a web sercie can work on any other internet protocol like SMTP, FTP, Jabber, and TCP.

For HTTP GET and HTTP POST method you can refer to these posts
https://nishantrana.wordpress.com/2007/10/22/calling-aspnet-web-service-from-javascript-ajax-passing-parameter/
https://nishantrana.wordpress.com/2007/10/22/calling-aspnet-web-service-from-javascript-ajax-passing-parameter-post/
The proxy class generated by Visual studio for us using the wsdl itself uses the SOAP.
Let’s take an example of calling the simple web service using SOAP through java script.
Say this is our sample web service

[WebService(Namespace = “http://myNamespace/”)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld(String name) {
return “Hello “+name;
}

}

The javascript code that we can use to call this web service using SOAP request would be this
<script type=”text/javascript”>
var xmlHttp;
function SoapCall()
{
// creatng the xmlHttp object
xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”);
// Calling the web service using post and true means asynchronous call
xmlHttp.open(“post”, “http://localhost/WebSite/WebSite4/Service.asmx&#8221;, true);
// Setting the request header to let the web service identify the soap request we would be sending
xmlHttp.setRequestHeader(“Content-Type”,”text/xml; charset=utf-8″);
// http://myNamespace/HelloWorld – name of the webmethod
//[WebService(Namespace = “http://myNamespace/&#8221;)] which we had applied to our web service class
xmlHttp.setRequestHeader(“SOAPAction”,”http://myNamespace/HelloWorld&#8221;);
xmlHttp.onreadystatechange=doUpdate;
// setting the soap request body
var soapRequest=”<?xml version=’1.0′ encoding=’utf-8′?>” +
“<soap:Envelope xmlns:xsi=’http://www.w3.org/2001/XMLSchema-instance'”+
” xmlns:xsd=’http://www.w3.org/2001/XMLSchema&#8217; xmlns:soap=’http://schemas.xmlsoap.org/soap/envelope/’>”+
“<soap:Body>”+
“<HelloWorld xmlns=’http://myNamespace/’>”+
“<name>Nishant Rana</name> “+
“</HelloWorld>”+
” </soap:Body>”+
“</soap:Envelope>”;


xmlHttp.send(soapRequest);
return false;


}

function doUpdate()
{
debugger;
if(xmlHttp.readyState==4)
{
var responseXMLResult=xmlHttp.responseXML;
var result = responseXMLResult.lastChild.nodeTypedValue;
alert(result);
}
}
</script>

We will receive the following Soap Response
<?xml version=”1.0″ encoding=”utf-8″?>
<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;
<soap:Body>
<HelloWorldResponse xmlns=”http://myNamespace/”&gt;
<HelloWorldResult>Hello Nishant Rana</HelloWorldResult>
</HelloWorldResponse>
</soap:Body>
</soap:Envelope>

We can create our SOAP request by making use of the test page of our Web Service which we can open in IE.

Or else we can use Fiddler tool. (http://www.fiddlertool.com/fiddler/)

Bye..

0x80041102 -the entity with ObjectTypeCode = 4408 was not found in the Metadata Cache. Platform


I was receiving this error while I was using the tool JSExportFromCRM – a useful tool to backup javascripts for CRM.

While looking for the same the solution I found was this

First I ran this query

SELECT * from entity WHERE objecttypecode = 4408

It returned nothing

Than I ran the following query and it

select * from organizationuibase where ObjectTypeCode = 4408

returned a row.

So ran the following query (i.e deleted that entry)

Delete from organizationuibase where ObjectTypeCode = 4408

And than again run the tool and it worked properly!!

Bye

Unhandled Exception: Microsoft.SharePoint.SPException: The form submission cannot be processed because it exceeded the maximum length allowed by the Web administrator. Please resubmit the form with less data.


Hi,

When one of our users tried uploading a picture of size somewhere around 3 mb in the picture library, he received the above mentioned error. Initial solution that we found in the kb article was to increase the httpRuntime within our web site.

<httpRuntime maxRequestLength=”51200” />

maxRequestLength –

Optional Int32 attribute. Specifies the limit for the input stream buffering threshold, in KB. This limit can be used to prevent denial of service attacks that are caused, for example, by users posting large files to the server. The default is 4096 KB. If the threshold is exceeded, a ConfigurationErrorsException is thrown.

But as we can see it is already set to somewhere around 50mb so that shouldn’t be the problem.

Thankfully the solution for this was to open central administration site

Central Administration > Application Management > Web Application General Settings

There change the

Maximum Upload Size which was set to 2 mb to
desired value.

Bye

Url Behaviour – Asp.NET web service


When adding a webreference to a webservice in visual studio we can set the Url Behaviour property inside visual studio.

In visual studio 2003 by default it is set to static and in visual studio 2005 it is set default to dynamic.

Static means the url is set in the code within the generated proxy class Reference.cs.

Normally this file doesn’t show up in visual studio. Using Show All Files option in visual studio displays this file.

This is what would be there in generated proxy class for Url Behaviour Static

public CrmService() {

this.Url = http://d-3324:5555/mscrmservices/2006/crmservice.asmx&#8221;;

And in case of Dynamic we will find a corresponding entry for the url in our application config file.

<applicationSettings>

<WindowsFormsApplication1.Properties.Settings>

<setting name=WindowsFormsApplication1_CrmSdk_CrmService serializeAs=String>

<value>http://d-3324:5555/mscrmservices/2006/crmservice.asmx</value>

</setting>

</WindowsFormsApplication1.Properties.Settings>

</applicationSettings>

And inside our proxy class

public CrmService() {

this.Url = global::WindowsFormsApplication1.Properties.Settings.Default.WindowsFormsApplication1_CrmSdk_CrmService;

Bye

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓