ItemArrayString

public static string ItemArrayString(this DataRow dr, string separator)
{
	return string.Join(separator, dr.ItemArray);
}

public static string ItemArrayString(this DataRow dr)
{
	return string.Join(",", dr.ItemArray);
}
Example:
DataTable dt = new DataTable("test");
dt.Columns.Add("ID", typeof(int));
dt.Columns.Add("NAME", typeof(string));
dt.Columns.Add("SURNAME", typeof(string));
dt.Rows.Add(1, "Rainmaker", "MIKE");
DataRow dr = dt.Rows[0];
string drValues = drValues = dr.ItemArrayString(); // 1,Rainmaker,MIKE
drValues = dr.ItemArrayString(","); // 1,Rainmaker,MIKE

Description

combin datarow's field value to string

Details

Double click on the code to select all.

 

;