 |
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

November 6th, 2015, 03:59 PM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Appendix B, p.790 - <connectionStrings>
Hi Imar,
I could publish the sample site in a temporary server for testing it. I also had to rename the name of the database.
My question is if changing this name, would I need to modify the <connectionStrings> with the new DB name only or another element else? And, are the parameters (Initial Catalog, ID, etc.) inside of it case sensitive?
Thanks, almost finished. A lot of questions, weren't they?
PS: When is ready I will put the link for you to give me your "last word". Hah.
Last edited by StvnSpnz; November 6th, 2015 at 04:27 PM..
|
|

November 6th, 2015, 04:50 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You may also need to change the data source (the server you're targeting) and maybe also the user name and password if any.
The name of the database is not case sensitive.
Cheers.,
Imar
|
|

November 6th, 2015, 05:13 PM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
The good thing I know is in the <connectionStrings> because I have access to the remote DB through SMSS, here I put the code for you to take a look:
Code:
<connectionStrings>
<add name="PlanetWroxConnectionString1" connectionString="Data Source=xxx.xxx.xxx;Initial Catalog=dbname;User ID=dbname;password=xxxxxxxx"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
<add name="PlanetWroxEntities" connectionString="metadata=res://*/App_Code.PlanetWrox.csdl|res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlClient;provider connection string="data source=xxx.xxx.xxx;Initial Catalog=dbname;Trusted_Connection=True;MultipleActiveResultSets=True;Integrated Security=True;"" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
I copied it from the web.config transformed.
Do I have to modify the <add name> or the metadata attribute too?
Thanks.
|
|

November 6th, 2015, 05:17 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> Do I have to modify the <add name> or the metadata attribute too?
Not if your EF model is called PlanetWrox. Otherwise you need to update that code to match your EF model.
BTW: you use two different connection types (integrated and SQL authentication) for the same database.
Imar
|
|

November 6th, 2015, 05:31 PM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Hi,
I found that the hosting folder had both web.config (web.config from local development and the web.host.config from the transformation), I suppose that the host executes the web.config. Therefore never had the right <connectionStrings>.
I published the web project again and it did it right. I can log in, but now I have the "Yellow screen of death" telling me when I click in PhotoAlbum/Gigs:
Keyword not supported: 'id'.
EntityException: The underlying provider failed on ConnectionString.
My connectionStrings again:
Code:
<connectionStrings>
<add name="PlanetWroxConnectionString1" connectionString="Data Source=xxx.xxx.xxx;Initial Catalog=dbname;User ID=dbname;password=xxxxxx;Integrated Security=False;" providerName="System.Data.SqlClient" />
<add name="PlanetWroxEntities" connectionString="metadata=res://*/App_Code.PlanetWrox.csdl|res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlClient;provider connection string="data source=xxx.xxx.xxx;Initial Catalog=dbname; Integrated Security=False;Id=dbname;Password=xxxxxx; MultipleActiveResultSets=True;"" providerName="System.Data.EntityClient" />
</connectionStrings>
Thanks.
Last edited by StvnSpnz; November 7th, 2015 at 09:07 AM..
|
|

November 7th, 2015, 09:22 AM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
I think now my problem is that the EF cannot connect. Should I change
"...metadata=res://*/App_Code.PlanetWrox..."?
See my previous post
Last edited by StvnSpnz; November 7th, 2015 at 09:25 AM..
|
|

November 7th, 2015, 10:15 AM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by StvnSpnz
Hi,
Keyword not supported: 'id'.
EntityException: The underlying provider failed on ConnectionString.
My connectionStrings again:
Code:
<connectionStrings>
<add name="PlanetWroxConnectionString1" connectionString="Data Source=xxx.xxx.xxx;Initial Catalog=dbname;User ID=dbname;password=xxxxxx;Integrated Security=False;" providerName="System.Data.SqlClient" />
<add name="PlanetWroxEntities" connectionString="metadata=res://*/App_Code.PlanetWrox.csdl|res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlClient;provider connection string="data source=xxx.xxx.xxx;Initial Catalog=dbname; Integrated Security=False;Id=dbname;Password=xxxxxx; MultipleActiveResultSets=True;"" providerName="System.Data.EntityClient" />
</connectionStrings>
Thanks.
|
My mistake.... Id intead User ID, now it worked....
Thanks for your valuable help, again.
Last edited by StvnSpnz; November 8th, 2015 at 01:40 PM..
Reason: Remove personal links on post
|
|

November 7th, 2015, 05:21 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
That's looking great (and familiar).
>> If want to see the biography text box CSS you told me, go to the NewTest Photo album which is the last one I did.
Yeah, exactly what I thought: a string without spaces which normal users won't enter.
Cheers,
Imar
|
|

November 7th, 2015, 05:49 PM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
You said in the appendix B that Windows Authentication is more secure than SQL Auth. But, is it possible when the web is hosted with third parties?
Thanks again for your help all these days.
PS: Yeah, familiar. It's like an architect learning to build the Eiffel Tower, again.
So the order for the next levels is (books)
Pro ASP
Security, Membership
MVC
AJAX?
Last edited by StvnSpnz; November 7th, 2015 at 05:55 PM..
|
|

November 7th, 2015, 05:55 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> But, is it possible when the web is hosted with third parties?
It depends on the host. Some do, some don't.
Imar
|
|
 |
|