19
2012
04

C# 进行数据库连接并将获得的表绑定到DataGridView中

//获取数据表信息并绑定到DataGridView中
TableClassBLL tableBLL = new TableClassBLL();
DataTable data = tableBLL.TableDBTable(where); //执行获取数据库中的表字段
DgvTable.DataSource = data;
DgvTable.AutoGenerateColumns = false; //手动生成列

public DataTable TableDBTable(string where)
...
19
2012
04

C# 进行登录数据库连接并保持连接信息

private void BtnConn_Click(object sender, EventArgs e)
{
if (CheckDBCon())
{
ConnHelper.IP = TxtIP.Text.Trim();
ConnHelper.DBName = TxtDBName.Text.Trim();
ConnHelper.UserID = TxtUserID.Text.Trim();
...
«1»