The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

DNN object qualifier

Last post 10-09-2007, 7:28 AM by Scott.Schecter. 5 replies.
Sort Posts: Previous Next
  •  10-09-2007, 3:14 AM 5704

    DNN object qualifier

    Code:
    dt = u.FillDataTable(esQueryType.StoredProcedure, QueryName, esQParams)
    

    results in: exec [].[].[Get_ReportParameters] @ReportID=2  

    How do I set the owner and object qualifiers in ES? To date I have unchecked this option and everything works fine.

    exec [].[].[Get_ReportParameters] @ReportID=2

    should end up read something like

    exec [dbo].[proc_Get_ReportParameters] @ReportID=2

    Declan

  •  10-09-2007, 5:54 AM 5709 in reply to 5704

    Re: DNN object qualifier

    If you check the option in template we parse the web.config entries for object qualifier and database owner.

    Regards,

    Scott Schecter
    EntitySpaces | My Site
  •  10-09-2007, 6:19 AM 5710 in reply to 5709

    Re: DNN object qualifier

    Scott.Schecter:
    If you check the option in template we parse the web.config entries for object qualifier and database owner.

    I have checked this option in MyGeneration.

    I assume you mean the DNN SqlDataProvider section in web.config, which in this case is:

    objectQualifier=""

    databaseOwner="dbo"

    If so the dbo is not picked up when I use

    esParams.Add("ReportID", QueryReportID)

    dt = u.FillDataTable(esQueryType.StoredProcedure, "Get_ReportParameters", esParams)

    What I see in SQL Profiler is:

    exec [].[].[Get_ReportParameters] @ReportID=1

    Declan

  •  10-09-2007, 6:40 AM 5714 in reply to 5710

    Re: DNN object qualifier

    If you looked in your generated classes, find this code
    Code:
    meta.Schema = "dbo";
    
    ProviderConfiguration providerConfiguration = ProviderConfiguration.GetProviderConfiguration("data");
    Provider provider = (Provider)providerConfiguration.Providers[providerConfiguration.DefaultProvider];
    
    string objectQualifier = provider.Attributes["objectQualifier"];
    
    if ((objectQualifier != string.Empty) && (objectQualifier.EndsWith("_") == false))
    {
    	objectQualifier += "_";
    }
    
    if (objectQualifier != string.Empty)
    {
    	meta.Source = objectQualifier + "Employees";
    	meta.Destination = objectQualifier + "Employees";
    	
    	meta.spInsert = objectQualifier + "proc_EmployeesInsert";				
    	meta.spUpdate = objectQualifier + "proc_EmployeesUpdate";		
    	meta.spDelete = objectQualifier + "proc_EmployeesDelete";
    	meta.spLoadAll = objectQualifier + "proc_EmployeesLoadAll";
    	meta.spLoadByPrimaryKey = objectQualifier + "proc_EmployeesLoadByPrimaryKey";
    }
    else
    {
    	meta.Source = "Employees";
    	meta.Destination = "Employees";
    					
    	meta.spInsert = "proc_EmployeesInsert";				
    	meta.spUpdate = "proc_EmployeesUpdate";		
    	meta.spDelete = "proc_EmployeesDelete";
    	meta.spLoadAll = "proc_EmployeesLoadAll";
    	meta.spLoadByPrimaryKey = "proc_EmployeesLoadByPrimaryKey";
    }
    add the meta.Schema by hand like above, and let me know if that corrects your profiler statement.

    Regards,

    Scott Schecter
    EntitySpaces | My Site
  •  10-09-2007, 7:16 AM 5716 in reply to 5714

    Re: DNN object qualifier

    I had both options checked:

    • Metada Class Should Ignore Schema
    • Metadata Class Should Ignore Catalog

    resulting in exec [proc_dws_ReportsLoadAll]

    Unchecking Ignore Schems added  meta.Schema = "dbo"

    gives me

    exec [dbo].[proc_dws_ReportsLoadAll]

     

    I guess SQL just ignores [].[]. and process everything after it as exec [].[].dws_ReportsLoadAll], as seen in Profiler, still gives the results.

    Thanks Scott.

  •  10-09-2007, 7:28 AM 5717 in reply to 5716

    Re: DNN object qualifier

    hehe that was going to be my next question;) You are correct, if no schema is specified we basically infer it for you at runtime(DNN or not), and I think the SQL profiler data was just confusing in this instance.

    Regards,

    Scott Schecter
    EntitySpaces | My Site
View as RSS news feed in XML