Wrox Programmer Forums
|
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
 
Old November 6th, 2015, 03:59 PM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default 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..
 
Old November 6th, 2015, 04:50 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 6th, 2015, 05:13 PM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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=&quot;data source=xxx.xxx.xxx;Initial Catalog=dbname;Trusted_Connection=True;MultipleActiveResultSets=True;Integrated Security=True;&quot;" 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.
 
Old November 6th, 2015, 05:17 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> 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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 6th, 2015, 05:31 PM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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=&quot;data source=xxx.xxx.xxx;Initial Catalog=dbname; Integrated Security=False;Id=dbname;Password=xxxxxx; MultipleActiveResultSets=True;&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

Thanks.

Last edited by StvnSpnz; November 7th, 2015 at 09:07 AM..
 
Old November 7th, 2015, 09:22 AM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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..
 
Old November 7th, 2015, 10:15 AM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by StvnSpnz View Post
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=&quot;data source=xxx.xxx.xxx;Initial Catalog=dbname; Integrated Security=False;Id=dbname;Password=xxxxxx; MultipleActiveResultSets=True;&quot;" 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
 
Old November 7th, 2015, 05:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 7th, 2015, 05:49 PM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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..
 
Old November 7th, 2015, 05:55 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> But, is it possible when the web is hosted with third parties?

It depends on the host. Some do, some don't.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
<STRONG> vs <B> and <EM> vs <I> anshul HTML Code Clinic 12 September 1st, 2004 05:22 PM
a problem in book<<beginning asp.net using vb>> luoware ASP.NET 1.0 and 1.1 Basics 3 December 8th, 2003 09:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.