0
votes

Hi, I have a problem using ASP MVC with C#. When I create an aspx page with a strongly typed inherit I received the following error:

Server Error in '/' Application.

Illegal characters in path. 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: Illegal characters in path.

Source Error:

Line 60: ///

Line 61: /// Connection String

Line 62: public ObjectContext(string connectionString)

Line 63: : base(connectionString, "Entity")

Line 64: {

I cannot solve this problem, in any webpage I create I received the same problem. I checked my web.config information on the internet but its ok, I re created the ado entity connection but the same happens.

This is my connection string on web.config:

add name="Entity" connectionString="metadata=res:///Models.model.csdl|res:///Models.model.ssdl|res://*/Models.Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=SOURCE\SQL;Initial Catalog=db;Persist Security Info=True;User ID=user;Password=password;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />

thank you so much!.

1

1 Answers

1
votes

I can see that your connection string looks wrong. Should be ....metadata=res://*/Models.model.csdl|res://*/Models.model.ssdl....

Just so you know the metadata represents this:

metadata=res://{assembly}/{namespace}.{filename}.csdl|res://{assembly}/{namespace}.{filename}.ssdl|res://{assembly}/{namespace}.{filename}.msl;

You can put the assembly name or the wildcard *, which it looks like you're missing on your csdl and ssdl