locked
Display custom page in CRM RRS feed

  • Question

  • Hi,

    I am new to .net & as well as CRM. I have developed a simple aspx page and want to display this page within CRM. I have added a link to this page at sitemap for CRM left navigation bar.

    I have deployed the code of this page under C:\Program Files\Microsoft Dynamics CRM\CRMWeb\ISV\AppName

    Then I can access this page without any problem at http://localhost:5555/ISV/AppName/Translate.aspx

    However, when I tried to open the same page within CRM http://localhost:5555/Titan/ISV/AppName/Translate.aspx I get following error:-

    "The connection name 'crm_translate' was not found in the applications configuration or the connection string is empty"

    Below is my complete web.config file

    <?xml version="1.0"?>
    <!--
        Note: As an alternative to hand editing this file you can use the
        web admin tool to configure settings for your application. Use
        the Website->Asp.Net Configuration option in Visual Studio.
        A full list of settings and comments can be found in
        machine.config.comments usually located in
        \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration>
        <appSettings/>
        <connectionStrings>
            <add name="crm_translate" connectionString="Data Source=.;Initial Catalog=crm_translate;Integrated Security=True"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
        <system.web>
            <!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.
            -->
            <customErrors mode="Off" />
            <compilation debug="true" />
            <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
            <authentication mode="Windows" />
            <identity impersonate="true" />
            <!--
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
        </system.web>
    </configuration>

    I know this is wrong because there is no reference to the CRMServiceUrl but I do not know how to correct it.

    Would anyone enlighten me, please, which way I ought to go from here? Thanks =)





    Friday, June 5, 2009 9:38 AM

Answers

  • Hi - Using dataconnections from within the crm website will fail when you have it in the web.config file.

    Build your connectionstring on pagelevel - codebehind file.

    Seems as you have the sqlserver on same server as the crm environment. :-)

            <asp:SqlDataSource ID="SqlDataSource" runat="server" 
                ConnectionString="Data Source=.;Initial Catalog=crm_translate;Integrated Security=SSPI" 
                ProviderName="System.Data.SqlClient" 
                SelectCommand="SELECTSTATEMENT">
            </asp:SqlDataSource>


    BR
    B

    • Proposed as answer by BJJ Friday, June 5, 2009 2:43 PM
    • Marked as answer by Samantha Lau Wednesday, June 10, 2009 2:51 AM
    Friday, June 5, 2009 2:43 PM

All replies

  • Hi - Using dataconnections from within the crm website will fail when you have it in the web.config file.

    Build your connectionstring on pagelevel - codebehind file.

    Seems as you have the sqlserver on same server as the crm environment. :-)

            <asp:SqlDataSource ID="SqlDataSource" runat="server" 
                ConnectionString="Data Source=.;Initial Catalog=crm_translate;Integrated Security=SSPI" 
                ProviderName="System.Data.SqlClient" 
                SelectCommand="SELECTSTATEMENT">
            </asp:SqlDataSource>


    BR
    B

    • Proposed as answer by BJJ Friday, June 5, 2009 2:43 PM
    • Marked as answer by Samantha Lau Wednesday, June 10, 2009 2:51 AM
    Friday, June 5, 2009 2:43 PM
  • Oh - And if you place sql on seperat server, be aware of kerberous. spn between crm and sql server must be present to use sspi.
    Friday, June 5, 2009 2:44 PM
  • Hi BJJ,

    Do you mean it is as simple as changing connectionstring tag with your example? Could you please give an example of SelectCommand="SELECTSTATEMENT">??

    btw, my CRM & SQL are on the same server.

    Thanks a lot!
    Friday, June 5, 2009 3:42 PM
  • hi - you propably managed by now.... A select statement could be "select accountid, name from filteredaccount"

    Brgds
    B
    Saturday, January 30, 2010 9:40 AM