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.Collections;
using System.Data.SqlClient;
namespace GHDBMS
{
public partial class 用户权限管理 : Form
{
public 用户权限管理()
{
InitializeComponent();
}
private void 用户权限管理_Load(object sender, EventArgs e)
{
string strConnection = "Data Source=SYY\\SQLEXPRESS;Initial Catalog=DB;Integrated Security=True";
SqlConnection objConnection = new SqlConnection(strConnection);
objConnection.Open();
SqlDataAdapter sda = new SqlDataAdapter("select * from YHGL",objConnection);
DataTable dt = new DataTable();
sda.Fill(dt);
用户列表.DataSource = dt;
修改.Enabled = false;
删除.Enabled = false;
objConnection.Close();
}
private void 添加_Click(object sender, EventArgs e)
{
string UserID = textBox1.Text;
string UserMC = textBox2.Text;
string UserMM = textBox3.Text;
string UserJB = comboBox1.Text;
string UserMS = richTextBox1.Text;
string strConnection = "Data Source=SYY\\SQLEXPRESS;Initial Catalog=DB;Integrated Security=True";
SqlConnection objConnection = new SqlConnection(strConnection);
objConnection.Open();
SqlCommand com = new SqlCommand("insert into YHGL(YHBH,YHMC,DLMM,YHJB,YHMS)values(UserID,UserMC,UserMM,UserJB,UserMS)", objConnection);
com.ExecuteNonQuery();
objConnection.Close();
用户权限管理_Load(sender,e);
}