using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace 图书管理系统
{
public partial class 登录窗口 : Form
{
//public static string ConnectionString = "Server=(local);database=图书管理库;uid=sa;pwd=1234"; //sql server 混合模式
// public static string ConnectionString = "Server=(local);Integrated Security=SSPI;database=图书管理库"; //windows模式
public string strSQL;
public SqlConnection myConnection;
public SqlCommandBuilder sqlCmdBld;
public DataSet ds = new DataSet();
public SqlDataAdapter da;
public int num=0;
private DataTable myTable;
private DataRow myRow;
public static string strUser;
public static string strPassword;
// public static string strDepartment;
public static bool login_flag = false;
public 登录窗口()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
private void 登录窗口_Load(object sender, EventArgs e)
{
linkdatabase link = new linkdatabase(); //实例化
myConnection = new SqlConnection(link.connectionstring()); //实例化连接
strSQL = "select * from 用户表 ";
da = new SqlDataAdapter(strSQL, myConnection);
ds.Clear();
da.Fill(ds, "用户表"); //////动作
myTable = ds.Tables["用户表"];
for (int i = 0; i < myTable.Rows.Count; i++)
{
comboBox1.Items.Add(myTable.Rows[i]["用户名"].ToString().Trim());
}
}
private void button1_Click(object sender, EventArgs e)
{
linkdatabase link = new linkdatabase(); //实例化
myConnection = new SqlConnection(link.connectionstring()); //实例化连接
strSQL = "sele
2019-12-21 19:23:36
7.26MB
管理
1