how bind DataList template field in asp.net

AzelGS

New Member
i want to bind a label -i created- in Datalist template to col -named "item"-in my dataSource i used the following code after several trials\[code\] DataList2.DataSource = dt; // my DataSource Label l1 = (Label)DataList2.FindControl("itemLabel"); l1.Text = dt.Rows[0]["item"].ToString(); DataList2.DataBind();\[/code\]i got the following error at line '3' i am looking for the right expression\[code\]Object reference not set to an instance of an object.\[/code\]any help would be appreciated..
 
Back
Top