Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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 8th, 2007, 05:27 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am adding a breakpoint here
Quote:
quote: Protected Sub FormView1_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertedEventArg s) Handles FormView1.ItemInserted
Not quite sure if this is the right place?

then when i run it debugging it show that line only then yellow
so i dont think that is the right line.

(and Imar thank you for all the help allready i hope i can fix this that would really help me out.)

 
Old October 8th, 2007, 05:55 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yellow means the breakpoint is hit. From there, you can use F10 and F11 to step through the code....

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old October 8th, 2007, 06:31 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i've checked all the breakpoints
and all thing go corectyle if you ask me.

I really have no more idees.

I'll show you the codes

 
Quote:
quote:Public Class Product
Quote:

#Region "Private Variables"

    Private _id As Integer = -1
    Private _title As String = String.Empty
    Private _description As String = String.Empty
    Private _price As Decimal = 0
    Private _author As String = String.Empty
    Private _categoryId As Integer = -1
    Private _pictureUrlSmall As String = String.Empty
    Private _pictureUrlMedium As String = String.Empty
    Private _pictureUrlLarge As String = String.Empty

 
Quote:
quote: ''' <summary>
Quote:
    ''' Haalt de author op van het product
    ''' </summary>
    Public Property Author() As String
        Get
            Return _author
        End Get

        Set(ByVal Value As String)
            _author = Value
        End Set
    End Property


 
Quote:
quote: ''' <summary>
Quote:
  ''' Adds a new product in the ShoppingCart.
  ''' </summary>
  ''' <param name="theProduct">A <see cref="Product">Product</see> that should be added to the ShoppingCart.</param>
  Public Shared Sub AddProductToCart(ByVal theProduct As Product)
    ShopManager.ShoppingCart.Add(theProduct)
  End Sub


 
Quote:
quote: ''' <summary>
Quote:
  ''' Inserts a new product in the database.
  ''' </summary>
  Public Shared Sub InsertProduct(ByVal theProduct As Product)
    Try
      Using myConnection As New SqlConnection(AppConfiguration.ConnectionString)

        Dim myCommand As SqlCommand = New SqlCommand("sprocProductInsertUpdateSingleItem", myConnection)
        myCommand.CommandType = CommandType.StoredProcedure

        If theProduct.Id = -1 Then
          myCommand.Parameters.AddWithValue("@id", DBNull.Value)
        Else
          myCommand.Parameters.AddWithValue("@id", theProduct.Id)
                End If
                myCommand.Parameters.AddWithValue("@title", theProduct.Title)
                myCommand.Parameters.AddWithValue("@description", theProduct.Description)
                myCommand.Parameters.AddWithValue("@price", theProduct.Price)
                myCommand.Parameters.AddWithValue("@author", theProduct.Author)
                myCommand.Parameters.AddWithValue("@categoryId", theProduct.CategoryId)
                myCommand.Parameters.AddWithValue("@pictureUrlSmal l", theProduct.PictureUrlSmall)
                myCommand.Parameters.AddWithValue("@pictureUrlMedi um", theProduct.PictureUrlMedium)
                myCommand.Parameters.AddWithValue("@pictureUrlLarg e", theProduct.PictureUrlLarge)

                myConnection.Open()

                myCommand.ExecuteNonQuery()
                myConnection.Close()
      End Using
    Catch ex As Exception
      ' Pass up the error; it will be caught by the code in the Global.asax and the generic error page set up in web.config.
      Throw
    End Try
  End Sub


I think that this is all
But i think its weard i only added the author lines and now he doesnt insert anything not even when i'm putting commeting tags around the author lines.

 
Old October 8th, 2007, 06:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

But that it ever hit this code? Does the Inserting event fire in the code behind of the page?

Sorry I am a bit vague; these kind of issues are almost impossible to debug remotely over a forum post....

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old October 8th, 2007, 06:52 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Imar

thank you verry much for all your fast help

ive got the mistake.
I had another column in my datbase that ive deleted from the insert function so it couldnt insert the database because a field was null.

but thank you verry much for all the help :D

 
Old October 8th, 2007, 11:16 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome....

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old October 9th, 2007, 06:51 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do have another question in the insert product fields the price field

i cant say a product costs 7,50 euro i can only say 7 or 8.
Though in the database i can use 7,50 is this a bug?

 
Old October 9th, 2007, 10:49 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Where "can't you say" this? Could it be a regional settings issue? E.g. you may need to enter 7.50 instead of 7,50?

AFAIK, all Price fields are doubles and decimals, so no rounding should occur.

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old October 24th, 2007, 07:29 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey imar

sorry for the late reaction i was working on a other project in the mean while that needed to be done.

but the , and . both dont work in the admin panel add that is.

but that's not the big deal.

im now stuck on the following thing:
i dont have a login.aspx page but a register.aspx page.

but when acces gets denied it sends people to login.aspx

ive searched the whole document for login.aspx but i can't find anything (only in the navigation)

 
Old October 24th, 2007, 03:48 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 Rebel,

You can set this in the web.config on the forms element like this:

<authentication mode="Forms">
  <forms loginUrl="~/Register.aspx" />
</authentication>

Whenever ASP.NET wants you to authenticate, it sends you to the loginUrl page....

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Breed (Rough Mix, 1991) by Nirvana (Track 11 from the album: With The Lights Out (Disc-2)) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding products to webshop not working. mcarol44 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 21 July 28th, 2011 09:09 AM
Adding Color and Size parameters to WEBSHOP Cart. DJPrice BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 March 10th, 2008 01:39 PM
Adding update feature to Webshop mcarol44 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 January 4th, 2008 12:53 PM
delay in adding tables kondapally Crystal Reports 0 January 12th, 2005 02:27 PM





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