2
Contributors
7
Replies
8
Views
4 Years
Discussion Span
Last Post by AleMonteiro
0

and then how can i retrive value from it.....
general code is as follows...

DataList1.DataKeyField = "Customer_ID,Product_ID";
String Product_ID = DataList1.DataKeys[e.Item.ItemIndex].ToString();
String Customer_ID = DataList1.DataKeys[e.Item.ItemIndex].ToString();

2

Maybe like this:

string keys[] = DataList1.DataKeys[e.Item.ItemIndex].ToString().split(',');
string productId = keys[0];
string customerId = keys[1];

Edited by AleMonteiro

Votes + Comments
Helpful.
0

not working geting error after including
string keys fixed[]=DataList1.DataKeys[e.Item.ItemIndex].ToString().Split(',');

Error 559 The type of a local declared in a fixed statement must be a pointer type

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.