In the login screen to achieve a username and password to check, prompted empty
private void Button1_Click(object sender, EventArgs e)
{
string id = textBox1.Text.Trim().ToString();
string pw = textBox2.Text.Trim().ToString();
if (id == null || id.Length == 0 || pw == null || pw.Length == 0) {
MessageBox.Show ( "user name or password can not be empty!");
return;
}
string connectionstring = "Data Source = D:\\sqlite\\db823.db";
SQLiteConnection connection = new SQLiteConnection(connectionstring);
connection.Open();
string sql = "select * from password where id = \"" + id + "\"";
SQLiteDataAdapter da = new SQLiteDataAdapter(sql, connection);
DataSet ds = new DataSet();
if (da != null) {
da.Fill(ds);
DataTable dt = ds.Tables[0];
if (dt == null || dt.Rows == null || dt.Rows.Count == 0 || dt.Rows[0][1] == null || !dt.Rows[0][1].Equals(pw))
{
MessageBox.Show ( "passwords do not match, please try again");
return;
}
else
{
MessageBox.Show ( "matching password");
Form2 form2 = new Form2();
form2.Show();
this.Hide();
}
}
}
todo:
1, the package database-related class of operation
2, data structures SQLiteDataAdapter, DataSet, DataTable particular API are not very familiar (== null determination of these I silent)
Next:
search page displaying a plurality of search results
Implementation function 1: Increase employees Three types of members (employee, manager, boss) as a subclass Worker makes a header file as a parent class Create a subclass - Worker.h, Manager.h, Boss....
table of Contents 1. Course Design Description 1 1.1 Project Overview 1 1.2 Design tasks and requirements 1 1.3 Development environment description 1 2. Demand analysis stage 1 2.1 Project introductio...
Project effect Put the login of the administrator in the panel. There are 6 forms for login, registration, loading, management, modification, and administrator operation. Sign in: registered: Modified...
Address Book Management System 1, system requirements The address book is a tool that can record relatives and friends. This tutorial mainly uses C ++ to implement a address book management system The...
A warehouse management system that counts how many products are produced. The basic functions are realized. increase: Add products produced at the current time to the database. Add products produced a...
C language-based warehouse management system! See the spring breeze, everything is wrong, I am in the east, I don't have the power, I'm looking for this micros, I also hope that there is a comrades, I...
C language warehouse management system include include include include struct data { int Amount; // quantity char name [20]; // Name int Num; // Number }food[100]; INT S = 0; // number of goods // Int...
C # WinForm + SQLServer Warehouse Management System One warehouse management system you do, there are two roles of administrators and teachers. The main modules are divided into login modules, user ma...