StrataFrame Forum

The DataSourceKey [] is not defined

http://forum.strataframe.net/Topic29341.aspx

By Nei Oliveira - 1/12/2011

Good Day

I have an application where WebForms mode locahost not have that kind of error, but when I publish my application of the following error.


 

Erro de Servidor no Aplicativo '/autenticacao'.

The DataSourceKey [] is not defined.

Descrição: Ocorreu uma exceção não tratada durante a execução da atual solicitação da Web. Examine o rastreamento de pilha para obter mais informações sobre o erro e onde foi originado no código.

Detalhes da Exceção: MicroFour.StrataFrame.Data.DataLayerException: The DataSourceKey [] is not defined.

Erro de Origem:

Exceção não tratada foi gerada durante a execução da atual solicitação da Web. As informações relacionadas à origem e ao local da exceção podem ser identificadas usando-se o rastreamento de pilha de exceção abaixo.

Rastreamento de Pilha:

[DataLayerException: The DataSourceKey [] is not defined.]   MicroFour.StrataFrame.Data.DataLayer.Create(BusinessLayer BusinessObject, ISynchronizeInvoke SyncObject, Boolean CheckDesignTime) +281   MicroFour.StrataFrame.Business.BusinessLayer.CreateDataLayer() +27   MicroFour.StrataFrame.Business.BusinessLayer.get__DataLayer() +80[DataLayerException: An error occurred while creating a new DataLayer for the business object.]   MicroFour.StrataFrame.Business.BusinessLayer.get__DataLayer() +139   MicroFour.StrataFrame.Business.BusinessLayer.FillDataTable(String SelectStatement) +18   BOSpConsult.BOUsuario.FillAutenticacao(String usuario, String senha) in C:\Users\user\Documents\Visual Studio 2008\Projects\Sp_Consult\BOSpConsult\BO_Tabelas\BOUsuario.vb:98   Autenticacao_FrmAutenticacao.btnLogin_Click(Object sender, EventArgs e) +116   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565



My global.asax is configured, do not know if something is missing
My base dde data is in a cloud server and works fine in local mode. I need to resolve this problem

Thanks
By Trent L. Taylor - 1/12/2011

So I assume that this is working on your development environment but not your deployed environment, correct?  Most likely it is one of two things:
  • Configuration error within IIS that is preventing the web application from executing properly and the global.asax is never being fired
  • You are running in an environment that is preventing the application from running with full trust and prevents the global.asax startup from ever triggering due to those permissions.

In both of these cases, the first thing to do is add a debug element to your distributed environment.  Most likely this executes and you can step through it on your development machine.  In the distributed environment, write to a log file or something along those lines to make sure that this code is even being executed.  My bet is that it isn't.
By Nei Oliveira - 1/12/2011

Thanks I'll follow your advice and if you did not bother to back success