yadagiri uppari

yadagiri uppari

  • NA
  • 277
  • 189.9k

how to bind data list in asp.net

Jul 2 2013 1:49 AM
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)