在asp.net上的预订需要帮助 [英] need help with booking on asp.net

查看:46
本文介绍了在asp.net上的预订需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

他目前在asp.net上做一个学校项目,基本上我只是一个初学者,我想通过使用日历和数据库中的数据来进行快速浏览,但是我无法使用2005 vb找出代码.感谢您的帮助

这是我的登录表单代码

hi currently doing a school project on asp.net ,basically i am just a beginner i wanted to do a boooking by using a calendar and data from database but i am unable to figure out the codes using a 2005 vb ...will appreciate help thanks

this my login form code

Dim conn As New OleDb.OleDbConnection
        conn.ConnectionString = " Provider=Microsoft.JET.OLEDB.4.0; Data Source=C:\Documents and Settings\gsi\My Documents\fyp.mdb"
        conn.Open()

        Dim cmd As New OleDb.OleDbCommand
        cmd.Connection = conn
        cmd.CommandText = "select * from [UserDirectory] where userid = '" & TextBox1.Text & "'"
        Dim reader As OleDb.OleDbDataReader
        reader = cmd.ExecuteReader

        If reader.Read Then
            ' Has a record that match
            If reader("Password").ToString = TextBox2.Text Then
                ' Successful login
                MsgBox("Valid")
                Session("UserID") = TextBox1.Text
                Response.Redirect("Main Menu.aspx")
            Else
                ' Unsuccessful
                MsgBox("Invalid")
            End If
        Else
            ' No such user
            MsgBox("Invalid")
        End If
    End Sub


这是我从mircosoft访问数据库到我的asp项目的数据检索代码


this is my data retrieval code from mircosoft access database to my asp project

Dim conn As New OleDb.OleDbConnection
        conn.ConnectionString = " Provider = Microsoft.JET.OLEDB.4.0; Data Source =C:\Documents and Settings\gsi\My Documents\fyp.mdb"
        conn.Open()

        Dim cmd As New OleDb.OleDbCommand
        cmd.Connection = conn 'Link to connection
        cmd.CommandText = "Select * from schedule "

        Dim buffer As OleDb.OleDbDataReader
        buffer = cmd.ExecuteReader() ' Store result into buffer

        'Transfer data in buffer to listbox
        While buffer.Read = True
            'There is still data from database
            ListBox1.Items.Add(buffer.Item(0).ToString & "," & buffer.Item(1).ToString)

        End While

推荐答案



这可能会对您有所帮助.

http://www.codeguru.com/csharp/.net/net_asp/controls/article.php/c12235 [ ^ ]

http://www.eggheadcafe.com/microsoft/ASP-NET/34026651/aspnet-booking-system.aspx [ ^ ]

问候,
爱德华
Hi,

This might help you.

http://www.codeguru.com/csharp/.net/net_asp/controls/article.php/c12235[^]

http://www.eggheadcafe.com/microsoft/ASP-NET/34026651/aspnet-booking-system.aspx[^]

Regards,
Eduard


这篇关于在asp.net上的预订需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆