Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Simple Password Form compare using database.Tq

Simple Password Form compare using database.Tq

Scheduled Pinned Locked Moved C#
databasecsharpsql-servergraphicssysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    krajah10
    wrote on last edited by
    #1

    Hello friends need help here.. Before this I have learn to create password validating form.Which is user have to key in password to enter another form. The password is default that have set in the coding.Now I need help how to connect to MY Sql database from C# from and compare the password that already I set in MY Sql database,table name Security and Field name password and the password is "ABCD".I dont know how to use SQL server 2005. Below are the coding for the first form that validate to enter to form2. ////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace cubaan1 { public partial class Form1 : Form { Form2 form1 = new Form2(); public Form1() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { textBox1.PasswordChar = '*'; //Masking Char textBox1.MaxLength = 14;//Max Length is 14 } private void button1_Click(object sender, EventArgs e) { string strDefaultPassword = "security"; //Keep the default password string strEnteredPassword = textBox1.Text; if (strEnteredPassword == strDefaultPassword) { this.Hide(); form1.ShowDialog(); } else { MessageBox.Show("Wrong password entered"); this.Close(); } } } } ////////////////////////////////////////////////////////// How to change this to connect to MY Sql Database and compare the password from the database. Tq in advance......

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups