Tuesday, January 17, 2012

Bind Simple Listview in asp.net

on aspx.cs page

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
binddrop(); bindgrid();

SqlConnection source_conn = new SqlConnection("Data Source=BSZ123\\SQLEXPRESS;Initial Catalog=Ecom_DB;Integrated Security=True");
SqlCommand cmd = new SqlCommand("SELECT * FROM Cart", source_conn);
da = new SqlDataAdapter(cmd);


da.Fill(ds);
list.DataSource = ds.Tables[0].DefaultView;
list.DataBind();


}
}





on aspx page


ID

city










'>















No Data Present





No comments: