none
crm2011 + problem while connecting to crm 2011 through another web site

    Frage

  • I am working on creating a web site from where I can connect to the CRM 2011

    Using this web site I want to retrieve and create new records (of crm entities) inside actual

    CRM site.;

    I have created the web site based on documentation I found on Microsoft MSDN site.

    Link: http://msdn.microsoft.com/en-us/library/gg695790.aspx

    I followed all the steps mentioned over here

    but some how I am not able to establish connection to the CRM 2011 through this site

    It is throwing following error
    Exception Details: System.Configuration.ConfigurationErrorsException: Unable to find a connection string with the name ''.

    Source Error:


    Line 148140:  /// Constructor.
    Line 148141:  /// </summary>
    Line 148142:  public XrmServiceContext()
    Line 148143:  {
    Line 148144:  }
     

    I have configured the web,config file as following


    <?xml version="1.0"?>


    <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
      <configSections>
        <section name="microsoft.xrm.client" type="Microsoft.Xrm.Client.Configuration.CrmSection, Microsoft.Xrm.Client"/>
      </configSections>
      <connectionStrings>
        <add name="Xrm" connectionString="Server=http://0.0.o.0:1111/Temp; Domain=Temp; Username=uname; Password=pwd;" />
      </connectionStrings>
      <microsoft.xrm.client>
        <contexts>
          <add name="Xrm" type="Xrm.XrmServiceContext,Xrm" connectionStringName="Xrm" />
        </contexts>
      </microsoft.xrm.client>
      <system.web>
        <pages>
          <controls>
            <add tagPrefix="crm" namespace="Microsoft.Xrm.Portal.Web.UI.WebControls" assembly="Microsoft.Xrm.Portal" />
          </controls>
        </pages>
      </system.web>
    </configuration>

    Mittwoch, 9. November 2011 14:25

Alle Antworten

  • hi krishna,

    i think you are not passing the connectionstring name in the XrmServiceContext constructor that is the reason you are getting this error.

    while creating XrmServiceContext instance pass connection string name as below.

    var CrmContext = new Xrm.XrmServiceContext("connectionstring");

    in your case it is

    var crm1 = new Xrm.XrmServiceContext("Xrm");

    Hope it helps.

    Dienstag, 18. Dezember 2012 07:30
  • check the servicecontextname in it .

    you need to add svcutil file into the website that is in appcode.


    ms crm

    Dienstag, 18. Dezember 2012 09:35