数据库中有张表test
其中id字段为primary key建立数据库连接之后
con.Open();
string sql = "select id from test";
SqlCommand cmd = new SqlCommand(sql,con);我想每查询出一个id,就根据id执行方法add(id)一次,总共有多少条记录就执行多少次,应当怎么做呢?或者selece * from test,然后申明一个DataSet1,将DataSet1帮定到一个DataGrid上,
然后在DataGrid1_ItemDataBound中实现调用方法add(id),请问应当怎么做呢?