Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 27th, 2014, 02:21 PM
Authorized User
Points: 416, Level: 7
Points: 416, Level: 7 Points: 416, Level: 7 Points: 416, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2013
Posts: 84
Thanks: 29
Thanked 2 Times in 2 Posts
Default Ch 19 Re-creating the database at the hosting server

Hi Imar,

I am having success deploying databases, but I keep getting a string of errors from the remote SQL server when I run my SQL scripts. The tables are created and the data loads, but I don't like seeing an error listing. Here is the list of errors I get:

Code:
Msg 15247, Level 16, State 1, Line 1
User does not have permission to perform this action.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 15247, Level 16, State 11, Line 1
User does not have permission to perform this action.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 15247, Level 16, State 1, Line 1
User does not have permission to perform this action.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
It seems like this error list is telling me that all the errors are associated with the first command, so I removed that line and it's associated Go command, but then I get another set of errors that say the same thing.

It keeps saying Line 1, but then it gives the same errors 3 times all against Line 1. I would have thought there would be an error listed for each line that is not accepted so one could examine all lines to remove.

I did edit out the CREATE DATABASE line because with my hosting service I create the database through their front end. Again, when I run the script against that database everything turns out OK. I just don't like the errors. Do we just ignore errors in SQL? It seems to me that ignoring error reports is at one's own peril.

I wondered if could comment on this.

Best Regards,
Alan

Last edited by AlanWheeler; February 27th, 2014 at 03:21 PM.. Reason: Title change
Reply With Quote
  #2 (permalink)  
Old February 27th, 2014, 03:57 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Ignoring errors is a bad idea as your database may be in an unknown state.

What code is causing the errors?

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!
Reply With Quote
  #3 (permalink)  
Old February 27th, 2014, 04:18 PM
Authorized User
Points: 416, Level: 7
Points: 416, Level: 7 Points: 416, Level: 7 Points: 416, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2013
Posts: 84
Thanks: 29
Thanked 2 Times in 2 Posts
Default

These are the first few lines of the SQL script file that caused the errors listed above:

Code:
ALTER DATABASE [Canvas] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [Canvas] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [Canvas] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [Canvas] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [Canvas] SET ARITHABORT OFF 
GO
The following lines are lines that I deleted before using the script that starts above:

Code:
CREATE DATABASE [C:\BEGASPNET\CANVASPROJECT1\APP_DATA\CANVAS1.MDF]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'Canvas1', FILENAME = N'C:\BegASPNET\CanvasProject1\App_Data\Canvas1.mdf' , SIZE = 4096KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'Canvas1_log', FILENAME = N'C:\BegASPNET\CanvasProject1\App_Data\Canvas1_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [C:\BEGASPNET\CANVASPROJECT1\APP_DATA\CANVAS1.MDF] SET COMPATIBILITY_LEVEL = 110
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [C:\BEGASPNET\CANVASPROJECT1\APP_DATA\CANVAS1.MDF].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
Best Regards,
Alan
Reply With Quote
  #4 (permalink)  
Old March 5th, 2014, 06:59 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You don't need all this. This sets some defaults for the newly created database, but your host typically has done that already, and doesn't allow you to change it.

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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
AlanWheeler (March 5th, 2014)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 19 Re-creating the Database AlanWheeler BOOK: Beginning ASP.NET 4.5 : in C# and VB 3 February 16th, 2014 01:43 PM
Ch. 19 and Appendix B MStarks BOOK: Beginning ASP.NET 4 : in C# and VB 6 November 20th, 2013 06:47 PM
Ch 19 not working either... resolutions BOOK: Beginning JavaServer Pages 6 May 17th, 2007 04:36 AM
Page 975; Ch 19 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 July 31st, 2006 12:25 AM
Page 973; Ch 19 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 July 31st, 2006 12:17 AM



All times are GMT -4. The time now is 04:17 PM.


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