Author: Unknown
•19:44
public void BindView(GridView dg, string datestr, string ars)
{
//打开数据库联接
try
{
myCommand = new OleDbDataAdapter(datestr, objConn);//myCommand 在基类中已经定义了
myCommand.Fill(ds, ars);
dg.DataSource = ds.Tables[ars].DefaultView;
dg.DataBind();
}
catch
{
//报告错误
HttpContext.Current.Response.Write("<script>alert('绑定GridView无法通过!')");
}
//关闭数据库连接
objConn.Close();
}
This entry was posted on 19:44 and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

1 评论:

On 2009年3月12日 22:30 , 匿名 说...

谢谢了