Sending a message based on selected row
I'm not sure of everything (worked with notepad) but:

protected void btnSendSMSForSpeceficUser_Click(object sender, EventArgs e)
{
    using (NoavaranModel.NoavaranEntities1 dbContext = new NoavaranModel.NoavaranEntities1())
    {
        var userId = int.Parse(Session["UserId"].ToString());

        var user = dbContext.Users.FirstOrDefault(p =&gt; p.UserId == userId);
        var countOfSms = user.CountOfSMS.Value;
        var j = 0;
        foreach (var row in grdStudents.Rows)
        {
            var cells = row.Cells;
            var MobileNumbers = cells[2].Text;
            var stID = int.Parse(cells[0].Text);

            var student = dbContext.Students.FirstOrDefault(p =&gt; p.Id == stID &amp;&amp; !p.IsRecivedSMS);

            var Ckbox = (CheckBox)row.FindControl("chkSelectStudents");
            if (Ckbox.Checked)
            {
                j++;
                if (j &lt;= countOfSms) {
                    Utility.SendMessageForStudents(MobileNumbers, txtMessage.Text);
                    student.IsRecivedSMS = true;

                    user.CountOfSMS = countOfSms - 1;
                }
            }
        }

        dbContext.SaveChanges();
        ListBox1.Items.Add(sendCount.ToString());
    }
}


This is a cleaner version of your code with less query (the first was unneccesary) and inside the loop you are making a lot of small query which can be really bad but first you have to modify your code to not work directly with the context in you page code but through an interface (first iterate through the rows and get all data then pass them to the worker (which can work with the context) and return the result &amp; update the UI).