Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 October 21st, 2013, 10:44 AM
Authorized User
 
Join Date: Apr 2013
Posts: 25
Thanks: 6
Thanked 0 Times in 0 Posts
Default how to edit and modify a database

hi

these are pictures for a database of a project I worked on last year

now this database needs some modification
renaming a table and some of its fields + adding two tables

note : I build the project and it'd database based on this book
that's why I'm writing in this section

my question is ,, how would I change and modify the database structure in a good way without affecting the functionality of the application

e.g.
the table College --> Section
the field CollegeName --> Section Name


or should i build a whole new database from scratch

I said I would ask first,, instead of messing up

http://www.shy22.com/upfiljpg/m3x66009.jpg


http://www.shy22.com/upfiljpg/brv66009.jpg
 
Old October 21st, 2013, 02:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

It depends a bit on how you implemented things, but here's what I would do:

1. Backup everything ;-)
2. Rename the tables / columns / add columns
3. Update the Linq to SQL diagram. This will generate a number of compile errors because of renaming the table.
4. Fix the errors manually
5. Search the site for the table and column names that have changed and update them manually. You're likely to find them within the data controls; the ones in Code Behind should have been caught by the compiler.

Hope this helps,

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 12th, 2013, 04:04 PM
Authorized User
 
Join Date: Apr 2013
Posts: 25
Thanks: 6
Thanked 0 Times in 0 Posts
Default I couldn't rename a table

I'm having a hard time renaming a table

and i couldn't delete it to create it again because of foreign key constraint

now ,, how can i possibly rename it ,, it's been almost 2 hours working at it
 
Old November 12th, 2013, 06: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

Hi there,

Which chapters / exercises is this referring to? Can you provide more information?

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 19th, 2013, 05:31 PM
Authorized User
 
Join Date: Apr 2013
Posts: 25
Thanks: 6
Thanked 0 Times in 0 Posts
Default chapter 11

chapter 11
Introduction to database

Try It Out | Creating Tables in the Table Designer

as I said before ,, I build this database and this website based on this book ,,


http://www.shy22.com/upfiljpg/cn696201.jpg

as shown in the picture ,, I wanna rename the table College ==> Section
and rename its field CollegeName ==> SectionName


I downloaded the sql server management 2005 ,, to be able to modify the database through the object explorer as I searched on the internet

but ,, I don't know why i can't find the library.mdf in the sql server management

http://www.shy22.com/upfiljpg/qow96201.jpg

Now ,, what should I do exactly to rename those two objects ?????????
 
Old November 19th, 2013, 06:57 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 need to attach the database first. In SSMS, right-click the Databases node, choose Attach and then browse to your .mdf file, wherever it's located.

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!
The Following User Says Thank You to Imar For This Useful Post:
Areej Abdu (November 22nd, 2013)
 
Old November 22nd, 2013, 03:40 PM
Authorized User
 
Join Date: Apr 2013
Posts: 25
Thanks: 6
Thanked 0 Times in 0 Posts
Default thnx

Ok ,, I attached it ,, and worked great ,, thanx

can you recommend a good book or a good reference to learn how to use SSMS efficiently





Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I modify database via Datagridview ? khauhoangbao C# 2005 1 May 13th, 2009 12:34 PM
modify multipale rows in database sanjeev jha Classic ASP Basics 0 November 3rd, 2007 02:08 AM
modify and update multipale rows in database sanjeev jha ADO.NET 0 November 2nd, 2007 02:04 AM
how will i edit data through database in aspnet Rajiv ASP.NET 1.0 and 1.1 Basics 1 October 21st, 2005 01:57 PM





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