View Single Post
  #2 (permalink)  
Old February 26th, 2004, 10:29 AM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

It looks to me like you have greatly over complicated this code. I don't think you need to write all that code that creates a table for the dataset. When you use the data adapter to fill the dataset, it will create the table for you. That would at least simplify things. Start with that and see where you get.

ds = new DataSet("ALMACEN");
da = new SqlDataAdapter ("SELECT id_producto, nombre FROM materia_prima", myConnection);
da.Fill(ds, "PRODUCTOS");
dlProductos.DataSource = ds.Tables[0];
dlProductos.DataKeyField = "id_producto";
dlProductos.DataBind();


Peter
------------------------------------------------------
Work smarter, not harder.