怎么样在DataView中实现模糊查询定位功能?
怎么样在DataView中实现模糊查询定位功能?
查询:
dv.RowFilter="FirstName like 'A%'";是可以的.
SqlConnection con=new SqlConnection("workstation id=yio;packet size=4096;user id=sa;data source=yio;persist security info=True;initial catalog=Northwind");
SqlDataAdapter da=new SqlDataAdapter("select * from Employees",con);
DataTable dt=new DataTable();
da.Fill(dt);
DataView dv=new DataView(dt);
dv.RowFilter="FirstName like 'A%'";
DataGrid1.DataSource=dv;
DataBind();
定位:
DataView.Find()