Transferring data from string into a Data View
I am trying to transfer data from a string to a Data View control, could someone demonstrate how this could be done:
private void testing_Click(object sender, EventArgs e)
{
// Get a Sc开发者_如何学编程heduledTasks object for the computer named "DALLAS"
string machineName = (@"\\" + System.Environment.MachineName);
ScheduledTasks st = new ScheduledTasks(machineName);
// Get an array of all the task names
string[] taskNames = st.GetTaskNames();
st.Dispose();
}
for (int i = 0; i < taskNames.Count; i++)
{
dataGridView1.Rows.Add(taskNames[i]);
}
精彩评论