private void btnInsert_Click(object sender, EventArgs e)
{
lstColumns.ValueMember = "Field";
for (int i = 0; i < lstColumns.SelectedIndices.Count; i++)
{
string strQuery = "," + ((DataRowView)(lstColumns.SelectedItems)).Row["Field"].ToString();
if (txtQuery.Text.ToString() == null || txtQuery.Text.Trim() == "")
{
txtQuery.Text = strQuery.Substring(1);
}
else
{
txtQuery.Text = txtQuery.Text.ToString() + " " + strQuery.ToString();
}
}
}
已经经过实践检验,哈哈 |