locked
Web Site and Virtual Directory RRS feed

  • Question

  •  

    Hi all,

     I have a web page , which is fetching data from the CRM database and displaying it on the form,

    If i deploy the webpage as a Virtual Directory Under CRM website in IIS Manager, it works fine,

    If i deploy it a s website in IIS manager , il not any value on the web page (I dont get any error)

     

    What is the reason for this, I want it to be deployed as web site,

    how can i achieve this..

    please help me on this..

     

    this is the code written in aspx page

     

    protected override void Render(HtmlTextWriter writer)

    {

    CrmService service = new CrmService();

    service.Credentials = System.Net.CredentialCache.DefaultCredentials;

    string strRegId = Request.QueryString["Id"].ToString();

    SqlConnection conn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=First_Solar_MSCRM;Data Source=pbgsqlsdlcvi08");

    conn.Open();

    string sqlquery = "select max(AVN.fslr_release_number)+1 as max from filteredfslr_additionalvolumenotification AVN Join filteredfslr_frameworkagreement FA on FA.fslr_frameworkagreementID=AVN.fslr_frameworkagreementid where AVN.fslr_frameworkagreementid=@strRegId and AVN.fslr_approveddate is not null ";

    sqlquery = sqlquery.Replace("@strRegId", "'" + strRegId + "'");

    SqlDataAdapter DataAdapter = new SqlDataAdapter(sqlquery, conn);

    DataAdapter.SelectCommand.CommandType = CommandType.Text;

    DataSet ds = new DataSet();

    string Max = "";

     

     

    DataAdapter.Fill(ds);

    Max = ds.Tables[0].Rows[0]["max"].ToString();

    Response.Write(Max);

    conn.Close();

    Thursday, November 20, 2008 8:01 AM

Answers

  • The reason is because you get data from CRM filteredview which requires CRM user priviledge.

    What you can do is either provide the user information or change your website apppool to run as a CRM user account with relevant priviledge.

     

    Cheers,

    Jim 

     

    Thursday, November 20, 2008 9:47 AM
    Moderator

All replies

  • Hi Vish,

    You should implement error handling/tracing in order to display the error message and determine where your application is failing.

    • Check that your web-site is running integrated authentication only.

    • Also ensure your web.config uses windows security and impersonates the users passed from IIS.

    Lastly you may also need to provide the network service account (which is most likely the account specified in the Application Pool) with additional rights. Alternately try specifying the same application pool as in MS CRM.


    As an example of tracing in a web application write:

                        HttpContext.Current.Trace.Write("CheckPoint 1 ");

    And modify your web.config to include tracing:

    <trace enabled="true" localOnly="false" pageOutput="true" />


    Cheers,

    Karlo


                      


    Thursday, November 20, 2008 9:25 AM
  • The reason is because you get data from CRM filteredview which requires CRM user priviledge.

    What you can do is either provide the user information or change your website apppool to run as a CRM user account with relevant priviledge.

     

    Cheers,

    Jim 

     

    Thursday, November 20, 2008 9:47 AM
    Moderator