CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> .NET

 login using

Print topic Send  topic

Author Message

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

i have the following table:


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                                              
        lbllogin.Text = " Sorry... try again,invalid username or password"            
           lbllogin.Font.Bold = True             
          lbllogin.ForeColor = Drawing.Color.Red                  
                         End If                         
     Catch ex As Exception      
    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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

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