<asp:ListBox runat="server" ID="txtName" Width ="200" Height="100" ></asp:ListBox>
DataSet ds = new DataSet();
string str = string.Format(@"SELECT DISTINCT Name FROM [dbo].[T_Table] WHERE ID='{0}'", id);
ds = objDbSQLAccess.funDataset_SQLExecuteNonQuery(str);
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
this.txtName.Items.Clear();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
string name = ds.Tables[0].Rows[i]["Name"].ToString();
this.txtName.Items.Add(name);
}
}