private void Form1_Load(object sender, System.EventArgs e)
{
//SqlDataReader oReader = null;
SqlConnection oConnection = null;
oConnection = new
SqlConnection("server=localhost;uid=sa;pwd=yaa li;database=FaraLinkCenter");

string sSelectSQL = "SELECT id as Name FROM tblDataGrid";
SqlCommand oCommand = new SqlCommand(sSelectSQL,oConnection);

SqlDataAdapter da = new SqlDataAdapter("Select * from tblDataGrid", oConnection);
//open the connection, and use the reader to populate the combobox
oConnection.Open();
//oReader = oCommand.ExecuteReader();

DataSet ds = new DataSet();
// fill dataset
da.Fill(ds, "tblDataGrid");// write dataset contents to an xml file by calling WriteXml method
// Attach DataSet to DataGrid
dataGrid1.DataSource = ds.DefaultViewManager; }


Could not copy temporary files to the output directory.
The file 'WindowsApplication1.exe' cannot be copied to the run directory. The process
cannot access the file because it is being used by another process.
The file 'WindowsApplication1.pdb' cannot be copied to the run directory. The process cannot access the file because it is being used by another process.