Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 December 13th, 2004, 01:35 PM
Registered User
 
Join Date: Dec 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default HelpMe

Please, check mi this code because don't show me vb
<%@ Page Language="vb" AutoEventWireup="false" Inherits="MojaKlasa"
src="MojaStrona.vb" %>





<html>

<HEAD>
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    </HEAD>
<body>
<form runat="server">
     <asp:label id="Status" runat="server" />
     <Table>
     <tr>
          <td>
 <asp:RadioButtonList id="rb" runat="server" AutoPostBack="True" OnServerValidate="displayMessage"/>
</td>
</tr>
</Table>
<p><asp:label id="SelectedSerwisant" runat="server" /></p>
<p id="text" runat="server" />
 </form>
 </body>
 </html>

------------------------------------------------
Imports System


Imports System.Collections
Imports System.Configuration
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
 Imports System.Data.OleDb


Public Class MojaKlasa

    Inherits System.Web.UI.Page

Protected WithEvents rb As System.Web.UI.WebControls.RadioButtonList
Protected WithEvents SelectedSerwisant As System.Web.UI.WebControls.Label
#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection

    End Sub
Protected WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
#End Region


dim rek(100),serw(100)
dim conn
dim dbcomm,sql,dbread,dbconn1,dbcomm1
dim dbconn as New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("baza/Blok1.mdb"))


dim strImie as string = "adam"
dim a=New SortedList





dim mycountries=New ArrayList
dim x
dim b(10)

Public Sub Page_Load()


dbconn.Open()



sql="SELECT Login,IloscZlecen FROM Blokowanie where Blok=True"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()



if Not Page.IsPostBack then
BlokM()
end if






dbread.Close()

dbconn.Close()



end sub

function BlokM()

x=0
Do While dbread.Read()


    'Authors.Items.Add(New ListItem(dbread.Item("Login") + " " + Cstr(dbread.Item("IloscZlecen"))))
    'Authors.Items.Add(New ListItem(dbread.Item("Login") + " " + (Cstr(x))))
    a.add((x),(dbread.Item("Login") + " " + Cstr(dbread.Item("IloscZlecen"))))


       x=x+1
   loop
     rb.DataSource=a
   rb.DataValueField="Key"
   rb.DataTextField="Value"
   rb.DataBind()


End function

sub displayMessage(s as Object,e As EventArgs)

dbconn.Open()



sql="SELECT Login,IloscZlecen FROM Blokowanie where Blok=True"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()



'CreateDataSource() As ICollection

Dim dt As DataTable
 dt = new DataTable()
  Dim dr As DataRow

  dt.Columns.Add(new DataColumn("StringValue1", _
    System.Type.GetType("System.String")))

x=0

'Czytanie z bazy kolumn
Do While dbread.Read()
    rek(x)=dbread.item("IloscZlecen")
    serw(x)=dbread.item("Login")

 x=x+1
loop
    '
    '
    '
          'SelectedSerwisant.Text=(x)
          'Zlecenia.DataSource=("adam")
          'Zlecenia.DataBind()
          SelectedSerwisant.Text="Serwisant: " & (serw(rb.SelectedItem.Value)) & " Ilosæ zleceñ: " & (rek(rb.SelectedItem.Value))




'response.write(rek(rb.SelectedItem.Value))
'response.write(rek(rb.SelectedItem.Value)+1)

dbread.Close()

dbconn.Close()


End Sub

Public Sub button1(Sender As Object, e As EventArgs)

'text.InnerHtml="You clicked the button"
'response.write("Adam")
'response.write(rek(rb.SelectedItem.Value))
Dim UpDate1
UpDate1="UPDATE Blokowanie SET IloscZlecen=IloscZlecen+1 WHERE Login='Aszo'"


ExecuteStatement(UpDate1)
End Sub

function ExecuteStatement(UpDate1)

dim objCmd as new OleDbCommand(UpDate1,dbconn)
try
            objCmd.Connection.Open()

            'objCmd.ExecuteNonQuery()



objCmd.ExecuteNonQuery()

dbconn.Close()
catch ex as Exception
            response.write("Wyst¹pi³ b³¹d aktualizacji bazy danych."+ex.message)
    end try

        objCmd.Connection.Close()

end function
End Class








Similar Threads
Thread Thread Starter Forum Replies Last Post
plz anybody HelpMe.............................. pushpa Classic ASP Databases 4 January 23rd, 2007 11:57 AM
helpme ! query ouput categorize by group on asp eyesonly Classic ASP Databases 0 January 23rd, 2004 04:15 AM





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