CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 login using vb.net?

Print topic Send  topic

Author Message
mekelle

Posts: 1
Posted: 03/17/2009, 11:00 PM

i have the following table:

logintable:

type, username, password, email

the type column has only two values , either "admin" or "user", username and email are unique.

i have a login page that asks username and password so as to login. here is the pretty code:
   
  
con = New SqlConnection("server=(local); Data Source=gig;Initial Catalog=dbvacancylist;User ID=sa;Password=test")        
  
  str = " select type, username,password from usersinfo"     
  
  
               cmdadapter = New SqlDataAdapter(str, con)      
  
     ds = New DataSet         cmdadapter.Fill(ds, "usersinfo")     
  
      Try             con.Open()        
  
       For Each dr In ds.Tables(0).Rows        
  
           If ((dr(0) = usernametxt.Text And dr(1) = passwordtxt.Text) Then                   
  
    Session("userloggedin") = usernametxt.Text             
  
                                                   Response.Redirect("addvacancy.aspx", False)            
  
           temp = True                                              
  
                  Else               
  
        lbllogin.Text = " Sorry... try again,invalid username or password"            
  
           lbllogin.Font.Bold = True             
  
          lbllogin.ForeColor = Drawing.Color.Red                  
  
                         End If                         
  
       Next               
  
     Catch ex As Exception      
  
         con.Close()       
  
    End Try              

the above code works fine, for both user and admin clients, but now i want to make it, if any one with type column is "user" and have correct username and password-- then redirects to userpage.aspx,

if any one with type column is "admin" and have correct username and password.. then redirects to adminpage.aspx, else error...

can u do that? off course you can, let me know it so, thanks
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.