C# 关键代码如下: (不明白 百度HI我)
DataSet ds = new DataSet();
DataTable dt = new DataTable();
ds = '数据库查询完的值';
dt = ds.Table[0];
for (int i = 0; i < dt.Rows.Count; i++)
{
this.ListBox.Items.Add(dt.Rows[i][要显示的值].ToString());
}
VB6.0
3个控件:Text1;Command1;DBlist1.
(用Listbox,为什么不用DBlist)
Private Sub Command1_Click()
Data1.RecordSource = "select * from (数据库的表名) where (数据库表的字段名) like '*" & Text1.Text & "*'"
Data1.Refresh
DBList1.Refresh
End Sub