Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Remember me

Go Back   Tutorialized ForumsWeb Design & DevelopmentASP.NET

Add This Thread To:   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
Unread Tutorialized Forums Sponsor:
Old March 7th, 2012, 04:28 PM
aspnoob aspnoob is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
Join Date: Mar 2012
Posts: 1 aspnoob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 12 sec
Reputation Power: 0
VS Error

The line shown at the bottom in the VB source file is not working, I have no real experience with ASP.NET so this is really foreign to me. Help would great.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="CustomerDisplay" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
    <style type="text/css">
            font-size: xx-large;
            font-size: large;
            width: 105px;
    <form id="form1" runat="server">
        <span style="color: blue; font-family: Arial" class="style1"><strong><em>SportsPro</em></strong></span><br />
        <span style="color: red" class="style2">Sports management software for the sports
            enthusiast</span><br />
        <br />
        Select a customer:&nbsp;
        <asp:DropDownList ID="ddlCustomers" runat="server" AutoPostBack="True" 
            DataSourceID="AccessDataSource1" DataTextField="Name" 
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            SelectCommand="SELECT [CustomerID], [Name], [Address], [City], [State], [ZipCode], [Email], [Phone] FROM [Customers] ORDER BY [Name]">
        <br />
        <br />
                <td style="width: 72px">
                <td class="style3">
                    <asp:Label ID="lblAddress" runat="server"></asp:Label></td>
                <td style="width: 72px">
                <td class="style3">
                    <asp:Label ID="lblCityStateZip" runat="server"></asp:Label></td>
                <td style="width: 72px">
                <td class="style3">
                    <asp:Label ID="lblPhone" runat="server"></asp:Label></td>
                <td style="width: 72px">
                <td class="style3">
                    <asp:Label ID="lblEmail" runat="server"></asp:Label></td>
        <br />
        <asp:Button ID="btnAdd" runat="server" Text="Add to Contact List" Width="144px" />&nbsp;
        <asp:Button ID="btnDisplay" runat="server" Text="Display Contact List"
            Width="144px" /><br />
        <asp:Label ID="lblErrorMessage" runat="server" ForeColor="Red"></asp:Label></div>

Imports System.Data

Partial Class CustomerDisplay
    Inherits System.Web.UI.Page

    Private SelectedCustomer As Customer

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
            Handles Me.Load
        If IsPostBack Then
        End If
        SelectedCustomer = Me.GetSelectedCustomer
        lblErrorMessage.Text = ""
    End Sub

    Private Function GetSelectedCustomer() As Customer
        Dim dvTable As DataView = CType(AccessDataSource1.Select( _
            DataSourceSelectArguments.Empty), DataView)
dvTable.RowFilter = "CustomerID = " & ddlCustomers.SelectedValue Code:
Original - dvTable.RowFilter = "CustomerID = " & ddlCustomers.SelectedValue Code
    dvTable.RowFilter = "CustomerID = " & ddlCustomers.SelectedValue
Dim drvRow As DataRowView = dvTable(0) Dim customer As New Customer customer.CustomerID = CInt(drvRow("CustomerID")) customer.Name = drvRow("Name").ToString customer.Address = drvRow("Address").ToString customer.City = drvRow("City").ToString customer.State = drvRow("State").ToString customer.ZipCode = drvRow("ZipCode").ToString customer.Phone = drvRow("Phone").ToString customer.Email = drvRow("Email").ToString Return customer End Function Private Sub DisplayCustomer() lblAddress.Text = SelectedCustomer.Address lblCityStateZip.Text = SelectedCustomer.City & ", " _ & SelectedCustomer.State & " " _ & SelectedCustomer.ZipCode lblPhone.Text = SelectedCustomer.Phone lblEmail.Text = SelectedCustomer.Email End Sub Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles btnAdd.Click 'Store customers that are added to the contact list in a sorted list whose key is CustomerID Dim ContactList As SortedList = Me.GetContactList Dim iCustomerID As Integer = SelectedCustomer.CustomerID If Not ContactList.ContainsKey(iCustomerID) Then ContactList.Add(iCustomerID, SelectedCustomer) 're-directs to contacts.aspx Response.Redirect("CustomerDisplay.aspx") Else lblErrorMessage.Text = "This customer is already in the contact list." End If End Sub Private Function GetContactList() As SortedList If Session("ContactList") Is Nothing Then Session.Add("ContactList", New SortedList) End If Return CType(Session("ContactList"), SortedList) End Function Protected Sub btnDisplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDisplay.Click End Sub End Class

Reply With Quote

Viewing: Tutorialized ForumsWeb Design & DevelopmentASP.NET > VS Error

Developer Shed Advertisers and Affiliates

Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap