I am trying to call a method from a foreach loop on each iteration and pass the string that is updated on each iteration to the method. How can I get the method I am calling to take the string?
Here is what I am testing:
foreach (DataRow dr in dt.Rows)
{
string url = "http://www.amazon.com/gp/offer-listing/"+dr["ASIN"].ToString();
updatedatabase(url);
}
Using this method:
private void updatedatabase(url)
{
MessageBox.Show(url);
}
One problem would be that you did not specify the type of the argument to your method. You could try this: