Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

miss nadia

@miss nadia
About
Posts
11
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem with class file
    M miss nadia

    i got problems with my class file. most of the errors saying that 'Object reference not set to an instance of an object'. it looks like all functions in class file cannot be performed, even i do declare the class at code-behind file. do i have to call the class file in .aspx page? like this <%# Imports ... %>. this is page for CheckOut.aspx.vb.

    Partial Class Checkout_CheckOut
    Inherits System.Web.UI.Page

    Private order As Order
    Private cust As Customer
    Private cart As ShoppingCart
    
    Protected Sub Page\_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
        cart = Session("cart")
    
        If Session("order") Is Nothing Then
            order = New Order(DateTime.Now, Nothing, Session("cart"))
            Session("order") = order
        Else
            order = Session("order")
            cart = order.Cart
        End If
    
        cust = New Customer(txtEmail.Text, txtLastName.Text, txtFirstName.Text, \_
            txtAddress.Text, txtCity.Text, txtState.Text, txtPostCode.Text, txtPhone.Text, \_
            txtEmail.Text)
        order.Cust = cust
    
        lblSubtotal.Text = order.SubTotal.ToString("c")
        lblShipping.Text = order.Shipping.ToString("c")
        lblTotal.Text = order.Total.ToString("c")
    End Sub
    
    Protected Sub Wizard1\_FinishButtonClick(ByVal sender As Object, ByVal e As  \_
        System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
    
        ' process credit card information here
        Dim success As Boolean
        success = OrderDB.WriteOrder(order)      'the function WriteOrder from OrderDB class 
        Session("cart") = Nothing                'can't be performed
        Session("order") = Nothing
        If success Then
            Response.Redirect("Confirmation.aspx")
        Else
            Response.Redirect("Confirmation.aspx?Error=1")
        End If
    End Sub
    

    End Class

    ASP.NET help design sales question

  • Image did not appear in DataList
    M miss nadia

    If i use binary data type for image, did i have to upload the image to DB? Is it a must to use upload function with generic handler? if i use upload function, does this means i need to upload images in separate table? i want to put images in my Products table, with all products' details. can i just put image path in DB and display the images in DataList? I need to display images for products, the details and the prices dynamically in repeated columns. I did the handler, but the image didn't appear, just the details appeared. I wonder so hard what's wrong with this. Is it my SqlDataSource or my handler?

    ASP.NET database question

  • Using DataList
    M miss nadia

    I use datatype varchar for image (put image path) and display in gridview, this is fine. But when i use the same datatype and display in datalist, the image didn't appear, but the description and price for the product appear. If i use binary for image, then i need to upload the picture to DB, rite? and also use generic handler. what is the easier way to display image for product and the details from different product categories (it's like e-commerce application)?

    ASP.NET question sysadmin

  • Using DataList
    M miss nadia

    How can i develop a product catalog that diplay a large picture of product and put the description with price under the picture? I use DataList, but the pictures don't appear. Is it true, if i use image handler, my data type for image must be in binary? My current data type for image now is varchar. <asp:DataList id="dlstImages" RepeatColumns="3" runat="server"> <ItemTemplate> <asp:Image ID="Image1" ImageUrl='<%# Eval("Name", "~/UploadImages/{0}") %>' style="width:200px" Runat="server" /> <br /> <%# Eval("Name") %> </ItemTemplate> </asp:DataList>

    ASP.NET question sysadmin

  • How can I know the location of error by Stack Trace given?
    M miss nadia

    And this is code for Order.aspx. Incorrect syntax that I can't find. That makes me really worried!

    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" AutoEventWireup="False" %>
    <%@ Register Src="~/Manage/Order.ascx" TagName="Order" TagPrefix="uc1" %>

    <script runat="server">

    Protected Sub Page\_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Not IsPostBack Then
            ddlOrder.DataBind()
        End If
        Session("OrderNum") = ddlOrder.SelectedValue
    End Sub
    

    </script>

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    Choose an order to display:
    <asp:DropDownList ID="ddlOrder" runat="server" AutoPostBack="True"
    DataSourceID="SqlDataSource1" DataTextField="OrderNum"
    DataValueField="OrderNum">
    </asp:DropDownList> 
    <asp:LinkButton ID="LinkButton1" runat="server"
    PostBackUrl="~/Manage/PrintOrder.aspx">Print this page</asp:LinkButton>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
    SelectCommand="SELECT OrderNum FROM Order ORDER BY OrderNum">
    </asp:SqlDataSource><br /><br />
    <uc1:Order ID="Order1" runat="server" />
    </asp:Content>

    ASP.NET question data-structures debugging help

  • How can I know the location of error by Stack Trace given?
    M miss nadia

    I'm using Web User Control for Order.aspx file. This is SQL code for Order.ascx.

    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
    SelectCommand="SELECT Order.OrderNum, Order.OrderDate, Order.CustEmail, Order.Subtotal, Order.Shipping, Order.Total,
    Customers.LastName, Customers.FirstName, Customers.Address, Customers.City, Customers.State, Customers.PostCode, Customers.Phone, Customers.Country
    FROM Order
    INNER JOIN Customers
    ON Order.CustEmail=Customers.Email
    WHERE Order.OrderNum=@OrderNum
    ORDER BY Order.OrderNum">
    <SelectParameters>
    <asp:SessionParameter Name="OrderNum" SessionField="OrderNum" Type="Int32" />
    </SelectParameters>
    </asp:SqlDataSource>

    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
    ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
    SelectCommand="SELECT [ProductId], [Name], [Price], [Quantity], [Total], [OrderNum]
    FROM [OrderItems]
    WHERE ([OrderNum]=@OrderNum)
    ORDER BY [ProductId]">
    <SelectParameters>
    <asp:ControlParameter Name="OrderNum" ControlID="FormView1"
    PropertyName="SelectedValue" Type="Int32" />
    </SelectParameters>
    </asp:SqlDataSource>

    ASP.NET question data-structures debugging help

  • How can I know the location of error by Stack Trace given?
    M miss nadia

    What does it means by OP? does this error looks complex? i hope it is not since i'm a beginner. i will post the codes and hope all of you will help.

    ASP.NET question data-structures debugging help

  • How can I know the location of error by Stack Trace given?
    M miss nadia

    I've checked many times for the incorrect syntax. But couldn't find any. There's no given location for the specific error. Here is the error and Stack Trace given when I run the appliication.

    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: Incorrect syntax near the keyword 'Order'.

    Stack Trace:

    [SqlException (0x80131904): Incorrect syntax near the keyword 'Order'.]
    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
    System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
    System.Data.SqlClient.SqlDataReader.get_MetaData() +62
    System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
    System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
    System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
    System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
    System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
    System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
    Syst

    ASP.NET question data-structures debugging help

  • Error in executing action of deleting and updating data from GridView
    M miss nadia

    this is the function in ShoppingCart class.

    Imports Microsoft.VisualBasic
    Imports System.Collections.Generic

    Public Class ShoppingCart

    Private \_cart As List(Of CartItem)
    
    Public Sub New()
        \_cart = New List(Of CartItem)()
    End Sub
    
    Public Function GetItems() As List(Of CartItem)
        Return \_cart
    End Function
    
    Public Sub AddItem(ByVal id As String, ByVal name As String, ByVal price As Decimal)
        Dim itemFound As Boolean = False
        For Each Item As CartItem In \_cart
            If Item.ID = id Then
                Item.Quantity += 1
                itemFound = True
            End If
        Next
        If Not itemFound Then
            Dim item As CartItem
            item = New CartItem(id, name, price, 1)
            \_cart.Add(item)
        End If
    End Sub
    
    Public Sub UpdateQuantity(ByVal index As Integer, ByVal quantity As Integer)    'update quantity function
        Dim item As CartItem
        item = \_cart(index)
        item.Quantity = quantity
    End Sub
    
    Public Sub DeleteItem(ByVal index As Integer) 'delete item function
        \_cart.RemoveAt(index)
    End Sub
    
    Public ReadOnly Property Count() As Integer
        Get
            Return \_cart.Count
        End Get
    End Property
    

    End Class

    ASP.NET help design announcement

  • Error in executing action of deleting and updating data from GridView
    M miss nadia

    That function is in ShoppingClass class.

    ASP.NET help design announcement

  • Error in executing action of deleting and updating data from GridView
    M miss nadia

    I'm developing an e-commerce web-based system & have problem in Shopping Cart part. i.e. update quantity & delete item from cart. This is code-behind for my Cart.aspx. <pre> 'other code above Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting cart.DeleteItem(e.RowIndex) 'error here GridView1.DataBind() End Sub Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing GridView1.EditIndex = e.NewEditIndex GridView1.DataBind() End Sub Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Dim cell As DataControlFieldCell cell = GridView1.Rows(e.RowIndex).Controls(3) Dim t As TextBox = cell.Controls(0) Try Dim q As Integer q = Integer.Parse(t.Text) cart.UpdateQuantity(e.RowIndex, q) 'error here Catch ex As FormatException e.Cancel = True End Try GridView1.EditIndex = -1 GridView1.DataBind() End Sub Protected Sub GridView1_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GridView1.RowCancelingEdit e.Cancel = True GridView1.EditIndex = -1 GridView1.DataBind() End Sub 'other code below </pre> The error saying that: Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Thanks for your help!

    ASP.NET help design announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups