2005-11-03

关于C# 查询 功能的实现代码

来源: 本站收集整理 作者:佚名 评论 0 条
 
this.dataGrid1.CaptionBackColor = System.Drawing.Color.RoyalBlue;
this.dataGrid1.CaptionForeColor = System.Drawing.Color.White;
this.dataGrid1.DataMember = "";
this.dataGrid1.DataSource = this.dataSet21.治理用户;
this.dataGrid1.FlatMode = true;
this.dataGrid1.Font = new System.Drawing.Font("Tahoma", 8F);
this.dataGrid1.ForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.GridLineColor = System.Drawing.Color.RoyalBlue;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.HeaderForeColor = System.Drawing.Color.Lavender;
this.dataGrid1.LinkColor = System.Drawing.Color.Teal;
this.dataGrid1.Location = new System.Drawing.Point(8, 192);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.Lavender;
this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.SelectionBackColor = System.Drawing.Color.Teal;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.PaleGreen;
this.dataGrid1.Size = new System.Drawing.Size(328, 152);
this.dataGrid1.TabIndex = 7;
//
// FrmLogin
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(352, 352);
this.Controls.Add(this.dataGrid1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FrmLogin";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "FrmLogin";
((System.ComponentModel.ISupportInitialize)(this.dataSet21)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);

}
#endregion



private void textBox1_TextChanged(object sender, System.EventArgs e)
{

}

public void FillDataSet(DataSet2 dataSet21)
{
//在填充数据集前关闭约束检查
//这答应适配器填充数据集而不用考虑
//表之间的依靠项
dataSet21.EnforceConstraints=false;
try
{
//打开连接
if(this.oleDbConnection1.State!=ConnectionState.Closed)
this.oleDbConnection1.Close();
this.oleDbConnection1.Open();
//尝试通过 oleDbDataAdapter1 填充数据集
this.oleDbDataAdapter1.Fill(dataSet21);

}
catch(Exception fillException)
{
//在此处添加错误处理代理
MessageBox.Show(fillException.Message);
}
finally
{
dataSet21.EnforceConstraints=true;
this.oleDbConnection1.Close();
}

}
public void LoadDataSet()
共6页: 上一页 [1] [2] [3] [4] 5 [6] 下一页
(本文仅表明作者个人观点,不代表本站及其管理员立场.) 推荐 收藏 投稿 打印 返回 关闭
上一篇:简单入门:非常基础的Servlet/JSP配置详解  
下一篇:成为优秀JSP程序员需要经历的九个阶段
    评论加载中…
 推荐文章
     

网站首页  -  网站地图 -   站长论坛  -  网站投稿  -    -  网站管理
Copyright © 2008 芜湖站长站 All Rights Reserved 皖ICP备07500611号