日期:2014-05-18  浏览次数:20478 次

疑似EF的链接字符串不对,再线等待朋友解决
webform采用的是普通开发+sqlite+ADO.Net 实体模型(EF)上传到网站后出现如下错误,请问如何解决




问题描述


Server Error in '/' Application.
--------------------------------------------

Keyword not supported: 'data source'. 
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.ArgumentException: Keyword not supported: 'data source'.



Source File: e:\webroot\kendeji\web\Index.aspx Line: 9 


Line 7:  
Line 8: <%
Line 9: ProConfigInfoData pcid = new ProConfigInfoData();
Line 10: ConfigInfoModel cim = pcid.QueryConfig();
Line 11: if (cim == null)
 




Stack Trace: 


[ArgumentException: Keyword not supported: 'data source'.]
  System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5110868
  System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
  System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +118
  System.Data.EntityClient.EntityConnection..ctor(String connectionString) +81
  System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString) +42
  System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) +16
  Dragon.F3._5.WebForm.DB.DragonWFSqliteEntities..ctor(String connectionString) +42
  Dragon.F3._5.WebForm.backstage.ConfigInfo.ProConfigInfoData..ctor() +50
  ASP.index_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in e:\webroot\kendeji\web\Index.aspx:9
  System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109
  System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
  System.Web.UI.Page.Render(HtmlTextWriter writer) +29
  System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
  System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
  System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060




看堆栈信息好像是链接字符串出了问题,ado.net实体在本地创建的时候指定了绝对路径,上传到服务器后已经修改了路径,单还是会报错。

出错的页面Index.aspx,我在这个页面new 了一个类,那个类在new 了一个实体模型。


 


------解决方案--------------------
是的,看看连接字符串data source写错没
------解决方案--------------------
看看你服务器上面的net版本~~~~