SqlConnection conn = null; SqlCommand cmd = null; SqlDataReader dr = null; String s = null; Product prod = null; try { conn = new SqlConnection("Provider=SQLOLEDB;SERVER=sissql2;UID=sa;PWD=AlfaRoma440;DATABASE=genericatest2"); s = " "; cmd = new SqlCommand(s,conn); dr = cmd.ExecuteReader(); // lleno el objeto producto while( dr.Read()) { } } catch (Exception ex) { // poner el manejo de errores } finally { dr.Close(); conn.Close(); } dr.Close(); conn.Close(); return prod; }
You need to create an account or log in to post comments to this site.