Monday, 15 July 2013

c# - Connecting to database - Object doesn't contain constructor that takes 1 argument -


I am trying to make a connection to the database and I am running in this error and do not know where from It's okay to start or what to do.

Error:
'Object' is not a constructor in which 1 argument occurs

  Public partial class DocMgmtDataContext {public DocMgmtDataContext ( ): Base (Configuration Manager Connection Connection ["Projects"]. Connection String) {On Crated (); }}   

In App.config

  & lt; Configuration & gt; & Lt; ConnectionStrings & gt; & Lt; Add name = "projects" connection string = "data source =. Initial catalog = overvalueprogress; integrated security = true" provider name = "system.data. SQL client" /> & Lt; / ConnectionStrings & gt; & Lt; / Configuration & gt;  

Inherit from your class the name for the database using a new context instance constructor Or using a given string as a connection string. Public partial class DocMgmtDataContext: DbContext {Public DocMgmtDataContext (): Base (Configuration Manager Connection Connection ["Projects"]. Connection String) {On Crated (); }}

No comments:

Post a Comment