Asp.net C# manually bind data to a listview?

RosauraRutenbar

New Member
I'm trying to take a cookie with a formatted string of product ids and quantity. I have it set up that I do the query and get the table data for each item in the cookie. Now I need to take the data, connect it to the listview. The cookie looks something like :1x4:23x9...\[code\]public partial class checkout : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { productTableAdapter ad = new productTableAdapter(); HttpCookie c = Request.Cookies["cart"]; if (c == null) { } else { string items = c.Value; new prod(items); if (items.Length > 0) { char[] delimiterChars = {':'}; string[] orders = items.Split(delimiterChars); char[] del = {'x'}; ObjectDataSource ods = new ObjectDataSource(); foreach( string s in orders){ string[] proc = s.Split(del); int id = int.Parse(proc[0]); int quant = int.Parse(proc[1]); DataSet1.productDataTable td = ad.GetDataByPID(id); // something..? } ListView1.DataSource = ods; ListView1.DataBind(); } } }}\[/code\]
 
Back
Top