CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > starter_kits_and_source_projects.commerce_starter_kit Tags:
Item Type: Date Entered: 2/24/2004 6:36:03 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 11 Views: 38 Favorited: 0 Favorite
12 Items, 1 Pages 1 |< << Go >> >|
"jwhitehe" <>
NewsGroup User
Help, Problem when making changes!2/24/2004 6:36:03 PM

0

I am trying to change all of the ModelNumber Tags (in the database tables/procedures and in .NET) to ISBN, but although I think I have changed them all I am still getting the message:

BC30456: 'ISBN' is not a member of 'IBuySpy.ProductDetails'.
Source Error:
Line 32: UnitCost.Text = String.Format("{0:c}", myProductDetails.UnitCost)
Line 33: ModelName.Text = myProductDetails.ModelName
Line 34: ISBN.Text = myProductDetails.ISBN.ToString()
Line 35: ProductImage.ImageUrl = "ProductImages/" & myProductDetails.ProductImage
Line 36: addToCart.NavigateUrl = "AddToCart.aspx?ProductID=" & ProductID

Is it as simple as somewhere there is a tag thats not been changed, or do I have to do something in SQL enterprise manager other than just change the names in procedures?

Any help will be great, as you can see I am new to this
"shmacgregor" <
NewsGroup User
Re: Help, Problem when making changes!2/24/2004 10:49:42 PM

0

iwhitehe,

Which database, OS, and database interface are you using?

Sandy

Sandy

"jwhitehe" <>
NewsGroup User
Re: Help, Problem when making changes!2/25/2004 11:14:07 AM

0

I am using windows XP, and SQL Server 2000 Enterprise Edition & Desktop Engine
"shmacgregor" <
NewsGroup User
Re: Help, Problem when making changes!2/26/2004 2:58:00 AM

0

iwhitehe,

Perhaps you would post the file in question so we can help.

Sandy

Sandy

"jwhitehe" <>
NewsGroup User
Re: Help, Problem when making changes!2/26/2004 10:37:44 AM

0

************* Edited by moderator Adec ***************
Inserted missing < code></ code> tags. Always include such
tags when including code in your postings
**************************************************

Hi Thanks for your help, this is the products details.aspx that I think has the problem. I have just tried to change all of the original ModelNumber headings to ISBN but it dosn't like it and im not sure why.

<%@ Page Language="VB" EnableViewState="false" %>
<%@ Register TagPrefix="IBuySpy" TagName="ReviewList" Src="_ReviewList.ascx" %>
<%@ Register TagPrefix="IBuySpy" TagName="AlsoBought" Src="_AlsoBought.ascx" %>
<%@ Register TagPrefix="IBuySpy" TagName="Menu" Src="_Menu.ascx" %>
<%@ Register TagPrefix="IBuySpy" TagName="Header" Src="_Header.ascx" %>
<%@ outputcache duration="60" varybyparam="ProductID" %>
<script runat="server">

'*******************************************************
'
' The Page_Load event on this page is used to obtain
' product information from a database and then update
' UI elements with them.
'
' Note that this page is output cached at 1 minute
' intervals. This eliminates the need to hit the database
' on each request to the page.
'
'*******************************************************

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

' Obtain ProductID from QueryString
Dim ProductID As Integer = CInt(Request.Params("ProductID"))

' Obtain Product Details
Dim products As IBuySpy.ProductsDB = New IBuySpy.ProductsDB()
Dim myProductDetails As IBuySpy.ProductDetails = products.GetProductDetails(ProductID)

' Update Controls with Product Details
desc.Text = myProductDetails.Description
UnitCost.Text = String.Format("{0:c}", myProductDetails.UnitCost)
ModelName.Text = myProductDetails.ModelName

ISBN.Text = myProductDetails.ISBN.ToString()

ProductImage.ImageUrl = "ProductImages/" & myProductDetails.ProductImage
addToCart.NavigateUrl = "AddToCart.aspx?ProductID=" & ProductID
ReviewList.ProductID = ProductID
AlsoBoughtList.ProductID = ProductID

End Sub

</script>
<html>
<head>
<link href="IBuySpy.css" type="text/css" rel="stylesheet" />
</head>
<body bottommargin="0" leftmargin="0" background="images/sitebkgrd.gif" topmargin="0" rightmargin="0" marginheight="0" marginwidth="0">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td colspan="2">
<IBuySpy:Header id="Header1" runat="server"></IBuySpy:Header>
</td>
</tr>
<tr>
<td valign="top" width="145">
<IBuySpy:Menu id="Menu1" runat="server"></IBuySpy:Menu>
<img height="1" src="images/1x1.gif" width="145" />
</td>
<td valign="top" align="left">
<table height="100%" cellspacing="0" cellpadding="0" width="620" align="left" border="0">
<tbody>
<tr valign="top">
<td>
<br />
<img src="images/1x1.gif" width="24" align="left" />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td class="ContentHead">
<img height="32" src="images/1x1.gif" width="60" align="left" /><asp:Label id="ModelName" runat="server"></asp:Label>
<br />
</td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="0" width="100%" border="0" valign="top">
<tbody>
<tr valign="top">
<td rowspan="2">
<img height="1" src="images/1x1.gif" width="24" />
</td>
<td width="309">
<img height="15" src="images/1x1.gif" />
<br />
<asp:image id="ProductImage" runat="server" border="0" width="309" height="185"></asp:image>
<br />
<br />
<img height="20" src="images/1x1.gif" width="72" /><span class="UnitCost">Your
Price:
&nbsp;<asp:Label id="UnitCost" runat="server"></asp:Label></span>
<br />
<img height="20" src="images/1x1.gif" width="72" /><span class="ISBN">ISBN:&nbsp;<asp:Label id="ISBN" runat="server"></asp:Label></span>
<br />
<img height="30" src="images/1x1.gif" width="72" />
<asp:hyperlink id="addToCart" runat="server" ImageUrl="images/add_to_cart.gif"></asp:hyperlink>
</td>
<td>
<table width="300" border="0">
<tbody>
<tr>
<td valign="top">
<asp:Label class="NormalDouble" id="desc" runat="server"></asp:Label>
<br />
</td>
</tr>
</tbody>
</table>
<img height="30" src="images/1x1.gif" />
<IBuySpy:AlsoBought id="AlsoBoughtList" runat="server"></IBuySpy:AlsoBought>
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table border="0">
<tbody>
<tr>
<td>
<img height="20" src="images/1x1.gif" width="89" />
</td>
<td width="100%">
<IBuySpy:ReviewList id="ReviewList" runat="server"></IBuySpy:ReviewList>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
"jwhitehe" <>
NewsGroup User
Re: Help, Problem when making changes!2/26/2004 6:25:34 PM

0

I think it is a problem with the IBUYSPY.Dll file for the namespaces. I have changed everything that I can see, but I cannot go any further, how do I change this?
"shmacgregor" <
NewsGroup User
Re: Help, Problem when making changes!2/26/2004 6:30:46 PM

0

iwhitehe,

OK. When asking for help you need to give the source of the problem as well as its result, so we can find the problem.

I'm using the VS.NET version while you're using the SDKFramework version; I'm using C# whlie you're using VB. But I think I can help.

In the line:
<img height="20" src="images/1x1.gif" width="72" />
<span class="ISBN">ISBN:&nbsp;<asp:Label id="ISBN" runat="server"></asp:Label></span>

the attribute 'class' it not a ModelNumber. class refers to the class name in the file IBuySpy.css and determines the style in which the ModelNumber is displayed. Leave that as it was for now. And remove the ISBN after the span tag. The ModelNumber within the bolt tage () can be replaced with 'ISBN Number', which is only text and functions as a description of the data to follow. Then you have:
<img height="20" src="images/1x1.gif" width="72" /><span class="ModelNumber"><b>ISBN Number:
&nbsp;<asp:Label id="ISBN" runat="server"></asp:Label></span>

You have declared ISBN to be the name of the asp:Label in id='ISBN". So next change the line:
ISBN.Text = myProductDetails.ISBN.ToString()
to:
ISBN.Text = myProductDetails.ModelNumber.ToString()

The ModelNumber in 'myProductDetails.ModelNumber.ToString()' is the string ModelNumber declared in the file ProductsDB.vb in the Components folder. When you get this string back from the function GetProductdetails it contains the ModelNumber from the database. Since you haven't changed the name of this string you must leave it as it is.

If you havn't made any other changes, and these don't work, let me know.

HtH

Sandy


Sandy

"shmacgregor" <
NewsGroup User
Re: Help, Problem when making changes!2/26/2004 8:57:51 PM

0

jwhitehe,

Changing one text symbol and one Lable name does not affect the namespaces. Why do you think namespaces are a problem?

Sandy

Sandy

"jwhitehe" <>
NewsGroup User
Re: Help, Problem when making changes!2/26/2004 9:58:28 PM

0

HI
I have changed everything to ISBN, both in the database and in .NET, nothing should say ModelNumber. the application only falls over when I click on a product for more detail, thats when I get the error msg. It is fine if I click on add to cart from the product lists, it includes the ISBN details in the cart.

As I understand it for product details there is the aspx page and the .VB page. the error msg is stating 'ISBN' is not a member of 'IBuySpy.ProductDetails', but as far as I can see it is. the code for the .VB file is shown below.

Im quite new to using ASP.NET & I get a bit frustrated when I cannot see what the problem is, thanks for your help.


Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient

Namespace IBuySpy

'*******************************************************
'
' ProductDetails Class
'
' A simple data class that encapsulates details about
' a particular product inside the IBuySpy Product
' database.
'
'*******************************************************

Public Class ProductDetails

Public ISBN As String
Public ModelName As String
Public ProductImage As String
Public UnitCost As Decimal
Public Description As String

End Class

'*******************************************************
'
' ProductsDB Class
'
' Business/Data Logic Class that encapsulates all data
' logic necessary to query products within
' the IBuySpy Products database.
'
'*******************************************************

Public Class ProductsDB

'*******************************************************
'
' ProductsDB.GetProductCategories() Method <a name="GetProductCategories"></a>
'
' The GetProductCategories method returns a DataReader that exposes all
' product categories (and their CategoryIDs) within the IBuySpy Products
' database. The SQLDataReaderResult struct also returns the
' SQL connection, which must be explicitly closed after the
' data from the DataReader is bound into the controls.
'
' Other relevant sources:
' + ProductCategoryList Stored Procedure
'
'*******************************************************

Public Function GetProductCategories() As SqlDataReader

' Create Instance of Connection and Command Object
Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim myCommand As SqlCommand = New SqlCommand("ProductCategoryList", myConnection)

' Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure

' Execute the command
myConnection.Open()
Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)

' Return the datareader result
Return result

End Function

'*******************************************************
'
' ProductsDB.GetProducts() Method <a name="GetProducts"></a>
'
' The GetProducts method returns a struct containing a forward-only,
' read-only DataReader. This displays all products within a specified
' product category. The SQLDataReaderResult struct also returns the
' SQL connection, which must be explicitly closed after the
' data from the DataReader is bound into the controls.
'
' Other relevant sources:
' + ProductsByCategory Stored Procedure
'
'*******************************************************

Public Function GetProducts(ByVal categoryID As Integer) As SqlDataReader

' Create Instance of Connection and Command Object
Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim myCommand As SqlCommand = New SqlCommand("ProductsByCategory", myConnection)

' Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure

' Add Parameters to SPROC
Dim parameterCategoryID As SqlParameter = New SqlParameter("@CategoryID", SqlDbType.Int, 4)
parameterCategoryID.Value = categoryID
myCommand.Parameters.Add(parameterCategoryID)

' Execute the command
myConnection.Open()
Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)

' Return the datareader result
Return result

End Function


'*******************************************************
'
' ProductsDB.GetProductDetails() Method <a name="GetProductDetails"></a>
'
' The GetProductDetails method returns a ProductDetails
' struct containing specific details about a specified
' product within the IBuySpy Products Database.
'
' Other relevant sources:
' + ProductDetail Stored Procedure
'
'*******************************************************

Public Function GetProductDetails(ByVal productID As Integer) As ProductDetails

' Create Instance of Connection and Command Object
Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim myCommand As SqlCommand = New SqlCommand("ProductDetail", myConnection)

' Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure

' Add Parameters to SPROC
Dim parameterProductID As SqlParameter = New SqlParameter("@ProductID", SqlDbType.Int, 4)
parameterProductID.Value = productID
myCommand.Parameters.Add(parameterProductID)

Dim parameterUnitCost As SqlParameter = New SqlParameter("@UnitCost", SqlDbType.Money, 8)
parameterUnitCost.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterUnitCost)

Dim parameterISBN As SqlParameter = New SqlParameter("@ISBN", SqlDbType.NVarChar, 50)
parameterISBN.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterISBN)

Dim parameterModelName As SqlParameter = New SqlParameter("@ModelName", SqlDbType.NVarChar, 50)
parameterModelName.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterModelName)

Dim parameterProductImage As SqlParameter = New SqlParameter("@ProductImage", SqlDbType.NVarChar, 50)
parameterProductImage.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterProductImage)

Dim parameterDescription As SqlParameter = New SqlParameter("@Description", SqlDbType.NVarChar, 3800)
parameterDescription.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterDescription)

' Open the connection and execute the Command
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()

' Create and Populate ProductDetails Struct using
' Output Params from the SPROC
Dim myProductDetails As ProductDetails = New ProductDetails()

myProductDetails.ModelName = CStr(parameterModelName.Value)
myProductDetails.ProductImage = CStr(parameterProductImage.Value).Trim()
myProductDetails.UnitCost = CType(parameterUnitCost.Value, Decimal)
myProductDetails.Description = CStr(parameterDescription.Value).Trim()
myProductDetails.ISBN = CStr(parameterISBN.Value)

Return myProductDetails

End Function
"shmacgregor" <
NewsGroup User
Re: Help, Problem when making changes!2/26/2004 10:31:44 PM

0

jwhitehe,

I glad you didn't change the namespace from IBuyStore, which is the name of the project.

Change:
myProductDetails.ISBN = CStr(parameterISBN.Value)
Back To:
myProductDetails.ModelName = CStr(parameterISBN.Value)

Also correct the two links I showed above, and run it. If it produces an error, show me the error and the first aspx page you showed. (Assuming you haven't changed anything else.)

Sandy


Sandy

"jwhitehe" <>
NewsGroup User
Re: Help, Problem when making changes!2/27/2004 9:54:36 AM

0

Hello, I made all of the changes that you suggested but I am still getting exactly the same error message, I have changed it back and the productDetails.aspx code is now the same as the first lot of code above, and the productDetails.vb is the also the same as above. I was hoping it would be something as simple as a spelling mistake, but I am just baffled.

I thought it would be simple to change everything from ModelNumber to ISBN, it worked for the shopping cart, just not product details.

Error msg:

BC30456: 'ISBN' is not a member of 'IBuySpy.ProductDetails'.

Source Error:



Line 32: UnitCost.Text = String.Format("{0:c}", myProductDetails.UnitCost)
Line 33: ModelName.Text = myProductDetails.ModelName
Line 34: ISBN.Text = myProductDetails.ISBN.ToString()
Line 35: ProductImage.ImageUrl = "ProductImages/" & myProductDetails.ProductImage
Line 36: addToCart.NavigateUrl = "AddToCart.aspx?ProductID=" & ProductID



"shmacgregor" <
NewsGroup User
Re: Help, Problem when making changes!2/27/2004 5:48:33 PM

0

jwhitehe,

The error you report says:
Line 34: ISBN.Text = myProductDetails.ISBN.ToString()

so you did not change that line back to:
Line 34: ISBN.Text = myProductDetails.ModelNumber.ToString()

Perhaps you should review my responses again.



Sandy

12 Items, 1 Pages 1 |< << Go >> >|


Free Download:













storing userid as variable

how do i change the application name?

getting users id, how???

remote aspnetdb.mdf

how can i check server port?

how to create different accounts

can't login with a userid created progammatically, using a login control..

log out code

make a filename hash without special characters

get collection of session ids

might be a stupid question..

add roles for user problem

custom memebrship provider problem

web user control problem in mix authentication with external roles

manager adminsitered web site

assigning userid to a record when created

encrypt conn string

encrypted authentification(ssl)

membership provider exposed via web services? microsoft oversight?

login control.......

must impersonate to access file on network-file-server, why?? please help i'm desperate

preventing users from entering a page

role authorization

how can we show all the users currently logged on?

forgothen your password ?? problem

cookie encryption

createuserwizard & roles

cryptography.cryptographicexception: bad data

i have discovered a security problem

writing excel log file - security error... unsuccessfully tried several things. help please!!!!

change password control cannot enter text

impersonate on one page for active directory updates

unable to delete the locked files on server!

different content display

forms authentication and 3rd party authentication

membershipprovider 'createuser' method

prevent access to crystal report .rpt file

remoting security exception - assembly trust issue?

serialize objects

aspnet regsql

problems with asp.net 2.0 security and deployment to a shared hosting environment

admin login project please help

possible to have a different profile per role??

how do i stop user createrwizard from duplicating emails?

problem w/ changepassword messages

managing access rules without using folders

asp.net 2.0 membership users not online?

dns problem

high bit characters and site internationalization (i18n)

createuserwizard - why don't the validation messages display?

   
  Privacy | Contact Us
All Times Are GMT