 |
BOOK: Beginning ASP.NET 4 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4 : 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
|
|
|
|
|

October 3rd, 2011, 08:14 PM
|
|
Authorized User
|
|
Join Date: Sep 2011
Posts: 37
Thanks: 13
Thanked 0 Times in 0 Posts
|
|
Need help with uploading final site/database to GoDaddy
So, I am done with the book (fantastic book btw!!!!)
The first thing I did is find in Appendix B how to set up SQL Server Management Studio and add the databases created in the project to it.
I then used the aspnet_regsql.exe to add the membership stuff to the PlanetWrox database (I only have a single database right now on GoDaddy).
I need to know first of all how to take the stuff that is already in the tables from aspnetdb (roles and logins and such) and move that data to the matching tables in the PlanetWrox database. This way when I upload the database it will have the information I have already worked with.
Second I need to know how to configure the web.config file to work with all these changes.
And Third if possible some more instruction on how to get the darn database tables and information into my GoDaddy database that I created would be awesome, I am quite lost at this point.
This is the first time in the book I have really been dumbfounded and not able to understand what I am reading so any help would be greatly appreciated!
Thanks for the help and support!!!
Sam
__________________
Noob, whole noob, nothing but a noob, so help me God. I will learn if it kills me.....
|
|

October 3rd, 2011, 08:20 PM
|
|
Authorized User
|
|
Join Date: Sep 2011
Posts: 37
Thanks: 13
Thanked 0 Times in 0 Posts
|
|
A quick change to the above. I now have 2 databases at GoDaddy so I do not need to or care to combine the 2 databases.
I just have to figure out how to get the databases uploaded on godaddy AND set up the web.config to work properly.
After 10+ hours of working on this today I think I might just go insane :P
__________________
Noob, whole noob, nothing but a noob, so help me God. I will learn if it kills me.....
|
|

October 3rd, 2011, 10:22 PM
|
|
Authorized User
|
|
Join Date: Sep 2011
Posts: 37
Thanks: 13
Thanked 0 Times in 0 Posts
|
|
Ok so another update.
I got the databases to work. When setting them up in GoDaddy you must set up 2005 servers for MSSql. The Dabatase Wizard will not work with 2008. Then when you do the upload it will convert all the information to 2005 if you are using 2008 to build with.
I hope this helps someone else because I spent over 10 hours trying to figure out why it would not work.
The only thing I am stuck on now is the <connectionstrings> settings in the web.config.
That part confuses the crap out of me and makes no sense, so if anyone can lay it out in plain english for me I would greatly appreciate it!
__________________
Noob, whole noob, nothing but a noob, so help me God. I will learn if it kills me.....
|
|

October 3rd, 2011, 11:21 PM
|
|
Friend of Wrox
|
|
Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts
|
|
Hi Samuel,
What is your problem exactly? Do you want to have 2 databases in Godaddy or only one database that combined 2 databases? In every case Do you want to know how to configure web.config connectionStrings?
__________________
Please excuse me for poor and bad English.
|
|

October 3rd, 2011, 11:23 PM
|
|
Authorized User
|
|
Join Date: Sep 2011
Posts: 37
Thanks: 13
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by morteza
Hi Samuel,
What is your problem exactly? Do you want to have 2 databases in Godaddy or only one database that combined 2 databases? In every case Do you want to know how to configure web.config connectionStrings?
|
I do not mind having 2 databases, I already have them set up
planetwroxdb for the PlanetWrox stuff
and
planetwroxusers for the ASPNETDB stuff
Here is the code I got from the book and I can not figure out what to change in it to make it work
Code:
<connectionStrings>
<clear/>
<add name="PlanetWroxConnectionString1" connectionString="Data source=DatabaseServer;Initial Catalog=PlanetWrox;User Id=planetwroxdb;Password=xxxx;" 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=DatabaseServer; Initial Catalog=PlanetWrox;User Id=planetwroxdb;Password=xxxx MultipleActiveResultSets=True"" />
<add name="LoalSqlServer" connectionString="DataSource=DataBaseServer;Initial Catalog=ASPNETDB;User Id=planetwroxusers;Password=xxxx;" providerName="System.Data.SqlClient"/>
</connectionStrings>
I have played with it a lot today and nothing seems to be working, hell my site is so messed up now I dont know if it will ever work :P
I sure would like to see it fully functional in a real world enviroment though if I can.
P.S. sorry for the edits, could not get the code to show properly.
__________________
Noob, whole noob, nothing but a noob, so help me God. I will learn if it kills me.....
Last edited by SamuelMSr; October 4th, 2011 at 11:29 AM..
|
|

October 4th, 2011, 12:22 AM
|
|
Authorized User
|
|
Join Date: Sep 2011
Posts: 41
Thanks: 3
Thanked 4 Times in 3 Posts
|
|
Connecting to DB on godaddy
Sam,
I recently put up a website on godaddy. At first, I was super baffled on how to use a DB on a webserver. But it is actually super easy. I don't know anything about transferring data from DB to DB. This is just explaining the plain basics on using the SQL Server database provided by godaddy.
****************
After you set up a SQL Server database on godaddy, within godaddy.com, go to your host settings.
- Find and go to your SQL Server database page. There is a link "Manage via web admin", click it. This brings up a new webpage where you must enter your database USER ID and PASSWORD.
- When you access your database web admin page, at the top left, you will see (the 2nd + item) a long string like: databasename.db.1234567.hostedresource.com ... YOU NEED THIS STRING, THIS IS THE SERVER YOU CONNECT TO WHEN YOU SET UP A CONNECTSTRING ...
***
So now, go back to Visual Web Developer, to test, make a simple page, drag a SqlDataSource control to it, click Configure Data Source.
- click New Connection
- click Change Data Source and select Microsoft SQL Server, click OK
- for Server Name, use the string I mentioned above (databasename.db.1234567.hostedresource.com, obviously, your string is different than this) ...
- click the Use SQL Server Authentication radio button and enter your web server database USER ID and Password (at this point, you can hit Test Connection at bottom left to test your connection)
- if the Test Connection succeeds, select a database just above Test Connection and click OK ... you will get a weird name, but you just set up a new ConnectString that connects to your web server DB ...
You might want to go back to the Database Web Server admin and set up a table within your database ... then, go back to VWD and your test page ... set up a gridview or something, use your new ConnectString, and you see how easy it is to work with your Web Server DB ... basically, you should now always use the new ConnectString for all your development ... because now, when you transfer the new webpage to the godaddy webserver to go live, the gridviews, etc. are all already configured with the new ConnectString and will easily connect to the same Web Server DB that you connect to while in development mode ...
Now, the rest is up to you ... good luck.
|
|
The Following 2 Users Say Thank You to nanonerd For This Useful Post:
|
|
|

October 4th, 2011, 01:02 AM
|
|
Authorized User
|
|
Join Date: Sep 2011
Posts: 37
Thanks: 13
Thanked 0 Times in 0 Posts
|
|
@nanonerd,
Dude you rock, I am now further then I have been in a very long time! I am not fully there yet and can use just a bit more help.
My database for logging in seems to be working great but the database for the planet wrox data (genres, etc...) is not yet.
You can see what my site is doing @ samuelmsr.com this is my deployment site to get this working (will be my business site later but I want to make this work so bad!).
Here is what I have in my code right now:
Code:
<connectionStrings>
<clear/>
<add name="PlanetWroxConnectionString1" connectionString="Data source=planetwroxdb.db.8267791.hostedresource.com;Initial Catalog=planetwroxdb;User Id=planetwroxdb;Password=xxxx;" 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=planetwroxdb.db.8267791.hostedresource.com;Initial Catalog=planetwroxdb;User Id=planetwroxdb;Password=xxxx MultipleActiveResultSets=True"" />
<add name="LocalSqlServer" connectionString="Data Source=planetwroxusers.db.8267791.hostedresource.com;Initial Catalog=planetwroxusers;User Id=planetwroxusers;Password=xxxx;" providerName="System.Data.SqlClient"/>
</connectionStrings>
I am guessing there is something on that second <add /> that is not working right but I can not figure out what.
If anyone can help you would be my new bestest friend!!! :D
I could just move on from here and start building but I have spent so much time on this that if I do not finish it I will go completely insane (rather then just a little nuts as I am right now lol).
Also, that is great how it is connected directly to the database at GoDaddy so that when working with the website all the data persists between developing and the live side, but when I try to work with the Database Diagrams it does not seem to want to do that. Is there a way around that?
Also to nanonerd, instead of logging into the management of your database if you click the edit picture (the pencil on the right side) it has that same info that you can highlight and copy :) Thought this might save you a bit of time in the future.
__________________
Noob, whole noob, nothing but a noob, so help me God. I will learn if it kills me.....
Last edited by SamuelMSr; October 4th, 2011 at 11:29 AM..
|
|

October 4th, 2011, 01:07 AM
|
|
Authorized User
|
|
Join Date: Sep 2011
Posts: 37
Thanks: 13
Thanked 0 Times in 0 Posts
|
|
OMG I GOT IT TO WORK!!!
Thank you nanonerd, what you told me worked like a charm! You can ignore the code in the above post, I just left out a ; and left out the providername on the second <add /> so once I fixed those things it worked great.
I love you guys for all the help, I hope even though I am moving on to a new book that I can still come hang here with you guys some time!!!
__________________
Noob, whole noob, nothing but a noob, so help me God. I will learn if it kills me.....
|
|

October 4th, 2011, 11:22 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Glad to hear it's now working.
Quick tip: edit your previous post and remove the servername, user IDs and password. It's a bit too easy now to log in to your database.... ;-)
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

October 4th, 2011, 11:23 AM
|
|
Authorized User
|
|
Join Date: Sep 2011
Posts: 41
Thanks: 3
Thanked 4 Times in 3 Posts
|
|
Sam,
good for you ... yeah man, I'm learning myself and I've been in your shoes before ... I TOTALLY know how that feels getting stuck on something for an entire day or longer ...
SUGGESTION: find other forums dedicated to asp.net, register, and post questions if you truly get stuck on something ... just don't abuse it ... make sure you really tried to figure it out first, 'cause there are others who will respect that and are willing to help ... this is a good one: http://forums.asp.net/ ... stackoverflow.com seems to be another good one ...
CAUTION: the database password is in plain text in your web.config and you just posted it for everyone to see ... ;-) ... 1) change your database password NOW (then open up web.config and change it there as well so your database apps can still connect) 2) next time you want to copy/paste your config file, just manually XXX out the password, you probably want to XXX out the userid as well [edit: xxx server name also] ... don't worry too much about not encrypting the web.config file, even after you put it on the godaddy server ... the general public cannot get access to it and although the staff at godaddy can see it if they want to, the database administrators already have access to your password anyways, even if you encrypted web.config ... so it's a situation of A) general public cannot see it B) the host staff can see it (if they want) but you trust them to not abuse it ... besides, encrypting is another whole ball of wax that is not simple to set up using a shared host such as godaddy.
Good luck bud ... and if you should ever be able to help out another "newb", pass it on ... ;-)
Last edited by nanonerd; October 4th, 2011 at 11:31 AM..
|
|
The Following User Says Thank You to nanonerd For This Useful Post:
|
|
|
 |
|