I'm trying to learn the Enterprise Library. I found this useful code sample to get data from a SQL database. But I tried to send data via a parameter. I'm also using the UPDATE, DELETE, and SAVE methods. Can you give me a similar sample? I'm using Enterprise Library 4.0.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
namespace WebApplicationForEnterpirires
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Database objdbase = DatabaseFactory.CreateDatabase("connectionString");
DataSet ds = objdbase.ExecuteDataSet(CommandType.StoredProcedure, "sp_GetProducts");
GridView1.DataSource = ds;
GridView1.DataBind();
}
}
}