微商建立网站,做ae动图的网站,互联网服务平台入口,北京自己怎样做网站一、数据库的建立
在fiber_yy数据库下创建yy_user_record表 可以先手动填入几条数据信息
初始数据库信息 username为用户账号 sex为用户注册所填写的性别 phone为用户手机号 time为用户登录该系统的时间
二、页面的设计
登录注册页面我就不演示了#xff0c;前几篇博文…一、数据库的建立
在fiber_yy数据库下创建yy_user_record表 可以先手动填入几条数据信息
初始数据库信息 username为用户账号 sex为用户注册所填写的性别 phone为用户手机号 time为用户登录该系统的时间
二、页面的设计
登录注册页面我就不演示了前几篇博文也都有介绍
flow_query流水查询页面
三、代码实现
flow_query流水查询页面
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Sql;
using System.Data.SqlClient;
namespace fiber_yy
{public partial class flow_query : Form{private DataSet dsall;public string constr serverCY-20190824RMES;Initial Catalogfiber_yy;User IDsa;pwdbeyond;private SqlDataAdapter mDataAdapter;public flow_query(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){try{SqlConnection conn new SqlConnection(constr);conn new SqlConnection(constr);mDataAdapter new SqlDataAdapter(SELECT username AS 用户,sex AS 性别,phone AS 手机号,time AS 登录时间 FROM yy_user_record, conn);dsall new DataSet();mDataAdapter.Fill(dsall, hard);MessageBox.Show(dsall.ToString());dataGridView1.DataSource dsall.Tables[hard];}catch{MessageBox.Show(读取失败);}}private void button2_Click(object sender, EventArgs e){string account textBox1.Text;try{SqlConnection conn new SqlConnection(constr);conn new SqlConnection(constr);//mDataAdapter new SqlDataAdapter(SELECT username AS 用户,sex AS 性别,phone AS 手机号,time AS 登录时间 FROM yy_user_record WHERE username account , conn);mDataAdapter new SqlDataAdapter(SELECT username AS 用户,sex AS 性别,phone AS 手机号,time AS 登录时间 FROM yy_user_record WHERE username account , conn);dsall new DataSet();mDataAdapter.Fill(dsall, hard);dataGridView1.DataSource dsall.Tables[hard];}catch{MessageBox.Show(读取失败);}}}
}
四、效果演示
程序运行 注册我就不演示了请参考前几篇博文 从yy_user表中找个账号密码直接用户登录 用户一旦成功登录系统会记录时间和用户信息
登录成功 进入系统
演示流水查询 查询所有用户登录信息 这里是6条记录原始数据库5条因为beyond登录了故会添加一条记录 精确查找 最终的数据库