DamithSL is correct.
By the way for error, try this code. this is just for your understanding. remember variables in
dt.Rows.Add()
must be in same sequence as columns are in table.
for (int i = 0; i < obj.Tables[0].Rows.Count; i++)
{
String stid = "id" + i;
String sname = "Sname" + i;
String dname = "Dname" + i;
String d = "D" + i;
String st = "St" + i;
dt.Rows.Add(stid,sname,dname,d,st);
}