public ListItemCollection SubCategorias(string li, string lf)
{
sql = "SELECT [Cod_Categoria], [Nom_Categoria] FROM [M_Categorias] WHERE (Cod_Categoria >="+Convert.ToInt32(li)+") AND (Cod_Categoria <= "+Convert.ToInt32(lf)+")";
comand = new SqlCommand(sql, con);
 
ListItemCollection col = new ListItemCollection();
 
reader = comand.ExecuteReader();
 
try
{
 
while (reader.Read())
{
col.Add(new ListItem(reader[1].ToString(), reader[0].ToString()));/ /DUDA ACA
 
}
return col;
 
}
catch (Exception)
{
 
throw;
}
finally
{
con.Close();
}
}
 
Mi pregunta seria pq NO es necesario una variable de tipo Listem para el metodo add del listitemcollection osea pq solo basta con la instancia de un Listitem?? 
 
y la otra como convierto un datarow a un gridviewrow, es posible????
 
Gracias de antemano. 
   
 


