Sunday, February 19, 2012

Deploy a database and ASP.NET site to GoDaddy.com

I have a vb.net web page which I created (a shopping cart). I created this site using vb.net 1.1 and SQL 2000 on my laptop. On my laptop everything works properly, but when I tried moving it to GoDaddy (http://currahee3-506.org/px/default.aspx). In the code, each query to the SQL server is done using stored procedures.

When you first go the page, a drop down is presented. When you select "Shirt" from the category drop down. A second drop down menu is then displayed and will let you select what type of shirt you are interested in purchasing. Select Polo Shirt Without Pocket. Upon doing so, I receive an error message:

Invalid object name 'tbl_LookupCategory'.
Invalid object name 'tbl_pxProducts'.
Invalid object name 'tbl_LookupColor'.
Invalid object name 'tbl_LookupSizes'.
Invalid object name 'tbl_pxQtySold'.
Invalid object name 'tbl_pxImages'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Invalid object name 'tbl_LookupCategory'.
Invalid object name 'tbl_pxProducts'.
Invalid object name 'tbl_LookupColor'.
Invalid object name 'tbl_LookupSizes'.
Invalid object name 'tbl_pxQtySold'.
Invalid object name 'tbl_pxImages'.

Source Error:

Line 143: sqlCommand.Parameters.AddWithValue("@.str_ItemName", Trim(DDL_Items.SelectedItem.Text))Line 144:Line 145: Dim dataReader As SqlDataReader = sqlCommand.ExecuteReader(CommandBehavior.CloseConnection)Line 146:Line 147: dl_Description.DataSource = dataReader


Source File:d:\hosting\currahee\px\default.aspx Line:145

Keep in mind the Stored Procedure works in my testing environment, but not on GoDaddy. I moved the selected statement into a view on the GoDaddy SQL server, and the view worked perfectly. The tables do exist on the GoDaddy SQL Server.

This is the Stored Procedure:

CREATE PROCEDURE [dbo].[sp_GetItemInfo]


@.str_ItemName VarChar(50)


AS


SELECT TOP 100 PERCENT
tbl_pxProducts.int_ItemID,
tbl_pxProducts.str_ItemName,
tbl_pxProducts.int_RetailPrice,
tbl_pxImages.str_SmallImageURL,
tbl_pxImages.str_MediumImageURL,
tbl_pxImages.str_MediumImageBackURL,
tbl_pxImages.str_LargeImageBackURL,
tbl_pxImages.str_LargeImageUrl,
tbl_pxImages.str_SmallImageBackURL,
tbl_pxProducts.int_Quantity - tbl_pxQtySold.int_QtySold AS int_QtyAvailable,
tbl_LookupCategory.str_Category,
tbl_pxProducts.Int_SizeID,
tbl_LookupSizes.str_Size,
tbl_pxProducts.Int_ColorID,
tbl_LookupColor.str_Color


FROM
tbl_LookupCategory
INNER JOIN
tbl_pxProducts
ON
tbl_LookupCategory.int_CategoryID = tbl_pxProducts.int_CategoryID
INNER JOIN
tbl_LookupColor
ON
tbl_pxProducts.Int_ColorID = tbl_LookupColor.int_ColorID
INNER JOIN
tbl_LookupSizes
ON
tbl_pxProducts.Int_SizeID = tbl_LookupSizes.int_SizeID
LEFT OUTER JOIN
tbl_pxQtySold
ON
tbl_pxProducts.int_ItemID = tbl_pxQtySold.int_ItemID
LEFT OUTER JOIN
tbl_pxImages
ON
tbl_pxProducts.int_ItemID = tbl_pxImages.int_ItemID


WHERE
(tbl_pxProducts.int_Quantity - tbl_pxQtySold.int_QtySold > 0)
AND
(tbl_pxProducts.str_ItemName = @.str_ItemName)

ORDER BY
tbl_LookupSizes.str_Size

Does anybody have any suggestions as to why this stored procedure is failing?

If you are sure that the tables exist then make sure you have the permissions to view/manage these tables.

The best what you can do here is to contact godaddy's support.

Regards

No comments:

Post a Comment