Copy Text to Clipboard
Posted on 2013-01-15
What do I need to change?
protected void cmdGetResearchList_Click(object sender, EventArgs e)
// Builds the symbol list for nasdaq.com
string strSymbolName1 = "";
foreach (GridViewRow row in grdWatchList.Rows)
strSymbolName1 += row.Cells.Text + ",";
txtResearchList.Text = strSymbolName1;
Clipboard.SetText(txtResearchList.Text); // Error here
Compiles but errors.
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
What should I change?