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.
|