1
Answer

how to bind data list in asp.net

yadagiri uppari

yadagiri uppari

11y
1.5k
1
please help me how to bind ... i am not getting any value
code:
                   string strSql = "sp_GetChatMessage";
             SqlParameter param5 = new SqlParameter("@senderid", Session["sender"]);
            SqlParameter param6 = new SqlParameter("@receiverid", Session["receiver"]);
           ds = SqlHelper.ExecuteDataset(CommonSetting.GetConnectionString(true), CommandType.StoredProcedure, strSql, param5, param6);
             DataTable tbl = new DataTable();
                  tbl.Columns.Add("SendrID", typeof(string));
                  tbl.Columns.Add("Message", typeof(string));
                  tbl.Columns.Add("Date", typeof(string));
                  DataRow dr = tbl.NewRow();
                  dr[0] = ds.Tables[0].Rows[0]["SenderID"];
                  dr[1] = ds.Tables[0].Rows[0]["Message"];
                  dr[2] = ds.Tables[0].Rows[0]["Date"];
                  dldisplayMessage.DataSource = tbl;
                  dldisplayMessage.DataBind();
Answers (1)