ATm
来源:互联网 发布:古风头像源码怎么用 编辑:程序博客网 时间:2024/04/28 22:19
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 ATM
{
public partial class Card : Form
{
DataSet ds = new DataSet();
SqlDataAdapter dataAdapter = null;
public Card()
{
InitializeComponent();
} string connStr = "Data Source=.;Initial Catalog=ATM;Persist Security Info=True;User ID=sa;Password=1234";
private void Card_Load(object sender, EventArgs e)
{
string sql = @"SELECT customerName as 客户姓名, PID as 身份证号, telephone as 电话, address as 地址 FROM userInfo";
SqlConnection connection = new SqlConnection(connStr);
dataAdapter = new SqlDataAdapter(sql, connection);
dataAdapter.Fill(ds);
this.dataGridView1.DataSource = ds.Tables[0];
}
private void button1_Click(object sender, EventArgs e)
{
string sql = @"SELECT customerName as 客户姓名, PID as 身份证号, telephone as 电话, address as 地址 FROM userInfo where 1=1";
if (textBox3.Text != "")
{
sql = sql + "and telephone like'%" + textBox3.Text + "%'";
}
if (textBox2.Text != "")
{
sql = sql + "and PID like'%" + textBox2.Text + "%'";
}
if (textBox1.Text != "")
{
sql = sql + "and customerName like'%" + textBox1.Text + "%'";
}
dataAdapter.SelectCommand.CommandText = sql;
ds.Tables[0].Clear();
dataAdapter.Fill(ds);
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
- ATM
- ATM
- ATM
- ATM
- ATM
- ATM
- ATM
- ATM
- ATM
- ATM
- ATm
- ATM
- ATM
- ATM
- ATM
- ATM
- ATM
- ATM
- mobile开发福音mac版之Fiddler
- ATM
- 科学的三个组成部分
- Visual C++ 2012入门经典(第6版) 课后练习(前言)
- C++获得文件大小
- ATm
- hdu1075What Are You Talking About (字典树)
- Linux下yum的介绍,配置,与使用
- (更新中.....)2014 Multi-University Training Contest 1总结
- nginx做代理服务器
- “镜像”折射下的中国设计
- 开发,从需求出发 · 之二 造飞机的工厂
- Roman to Integer
- 设置Android设备在睡眠期间始终保持WLAN开启的代码实现