sqlda:=OleDbDataAdapter.Create('Select filed from table','Provider="Microsoft.Jet.OLEDB.4.0";Data Source="'+Server.MapPath('database\data.mdb')+'";Persist Security Info=True;Password=');
ds:=DataSet.Create;
  sqlDa.Fill(ds,'filed');
  dt:=ds.Tables['filed'];
  Self.DataGrid1.DataSource:=dt.DefaultView;
  Self.DataGrid1.DataKeyField:='filed';
  Self.DataGrid1.DataBind;代码我是用Delphi写的,相信大家都能看懂,就是随便从数据表里查询出一个字段的值。用一个DataGrid来显示查询出的值。
那么大家发现我DataGrid数据绑定完后,没有其他代码了。那么这时候还存在数据库连接吗?需要每次查询完成后都要关闭数据连接吗?如果不关闭又会怎么样?