Desenvolvimento pós site desenvolvido (LINQ & Web.config)
Salve pessoal.
Seguinte:
Desenvolvi um projeto que consulta o bando de dados. Só que está dando erro com o LINQ.
O LINQ usa o web.config como referencia de conexão, o problema é que o site onde irei implementar, o web.config já existe, e como padrão existirá apenas ele.
Como eu altero a referencia do LINQ? Detalhe, o Web.config não fica na mesma página.
Posso no Connection do LINQ trocar manualmente? Ex:"~\Pasta1\Pasta2\Web.config"
Brigado desde ja!
Absss
Eu vo postar o erro.
>
Server Error in '/teste02' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
consultaLINKDataContext..ctor() in E:\Quanti\Desenvolvimento\Fonte\QuantiNet\Pages\Adm\ControleBanner\App_Code\consultaLINK.designer.cs:37
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.Web.HttpRuntime.FastCreatePublicInstance(Type type) +96
System.Web.UI.WebControls.LinqDataSourceView.CreateContext(Type contextType) +6
System.Web.UI.WebControls.LinqDataSourceView.CreateContextAndTable(DataSourceOperation operation) +680
System.Web.UI.WebControls.LinqDataSourceView.CreateContextAndTableForSelect() +91
System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +383
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
Nós usamos duas database, uma como teste e outra como oficial. Quando desenvolvi esse projeto eu acabei utilizando o database oficial, porém ficou sendo necessário desenvolver apontando para o teste.
Tem um GridView que usa um datasoucer para conexão, e é o erro que acontece que coloque dentro do Quote.
Já nas outras páginas quando executo os comandos de consulta aparece os resultados da database oficial ao invés de aparecer da de teste, lembrando que eu já alterei o LINQ.
Alguma surgestão?
Brigadão...
abssss
Discussão (4)
Carregando comentários...