Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework Connection String Definition

I was just wondering that, what is Entity Framework Connection String really mean? Like:

metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=testSource;initial catalog=CatalogName;user id=sa;password=***********;multipleactiveresultsets=True;application name=EntityFramework"

I am aware of provider=System.Data.SqlClient; provider connection string="data source=testSource; initial catalog=CatalogName; user id=sa; password=**

Can anyone tell me what does string metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl; mean?

And, one more thing i need to confirm, if i want to edit in the Entity Connection String, can i do it?

like image 682
HarshSharma Avatar asked Jan 15 '14 10:01

HarshSharma


People also ask

What is meant by connection string?

A connection string is a string that contains information about a data source (usually a database engine), as well as the information necessary to connect to it.

What is connection string and where it is defined?

A connection string contains initialization information that is passed as a parameter from a data provider to a data source. The data provider receives the connection string as the value of the DbConnection. ConnectionString property.

What is connection string in .NET core?

ASP.NET Core For instance, you can use the Secret Manager tool to store your database password and then, in scaffolding, use a connection string that simply consists of Name=<database-alias> . Or the following example shows the connection string stored in appsettings. json .

What is connection string providerName?

The providerName attribute is used to set the name of the .NET Framework data provider that the DataSource control uses to connect to an underlying data source. If no provider is set, the default is the ADO.NET provider for Microsoft SQL Server.


2 Answers

The metadata field is required in an EF connection string and specifies:

A pipe-delimited list of directories, files, and resource locations in which to look for model and mapping information.

(source: http://msdn.microsoft.com/en-us/library/system.data.entityclient.entityconnection.connectionstring.aspx)

Or put in other words:

The pointer to the metadata files (Conceptual Schema Definition Layer [CSDL], Mapping Schema Layer [MSL], and Store Schema Definition Layer [SSDL])

(source: http://msdn.microsoft.com/en-us/library/orm-9780596520281-01-16.aspx)

like image 66
Vincent Avatar answered Sep 29 '22 18:09

Vincent


Everything what you need, you have in manual:

http://msdn.microsoft.com/en-us/library/cc716756%28v=vs.110%29.aspx#fbid=FpiOK3ZYdUD

like image 39
Rayet Avatar answered Sep 29 '22 19:09

Rayet