read all the rows ?

Plue_41261h

New member
Joined
Oct 29, 2008
Messages
3
Programming Experience
Beginner
I am very new in VB code and so currently i need to develop a simple login page but i do not know how to check the input by users. If u realise in my code i can only read one row of data in the table.

Is there any way to loop it or read all the rows ??? Thanks very much.





VB.NET:
Protected Sub BtnStaffLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        
        
        [COLOR="yellowgreen"]'Declare a ODBC Connection with the Connection String 
        'stored in the Web.Config File [/COLOR]
        Dim strConn As System.Configuration.ConnectionStringSettings
        strConn = ConfigurationManager.ConnectionStrings("ODBCDataConnectionString")

        Dim conn As OdbcConnection = New OdbcConnection(strConn.ToString())

       [COLOR="YellowGreen"] 'Every database operation requires a SQL Command 
        'Should specify a SELECT, INSERT, UPDATE or DELETE[/COLOR]  
      Dim cmd As New OdbcDataAdapter("Select * From Ticket", conn)
        
        
        Dim SLogin As New DataSet
        cmd.Fill(SLogin, "Staffinfo")
        
        If SLogin.Tables("Staffinfo").Rows(0).Item("Username") = txtStaffUsername.Text Then
            Response.Redirect("CreateTicket.aspx")
        Else
            lblMessage.Text = "Sorry wrong username and password"
        End If
 
Last edited by a moderator:
I would start off here in the 14 part series of ASP.NET security best practices.

There is an ASP.NET section of the forums. Posting in the correct section will give you a higher chance of somebody with the correct experience to see your question.
 
Thanks buddy, i got it solved though haha. Btw do you know of any good tutorials or resources to create a simple message board? I need it for my trouble Ticket system.
 

Latest posts

Back
Top