indradeo says:
public
void
btnSendMail_Click(
object
sender, System.EventArgs e)
{
string
Id =
string
.Empty;
DataTable dt =
new
DataTable();
try
{
foreach
(GridViewRow row
in
GridView1.Rows)
{
Id = Convert.ToString(GridView1.DataKeys[row.RowIndex].Value);
CheckBox cb = (CheckBox)row.FindControl(
"chkSelect"
);
string
flag = cb.Checked ?
"Y"
:
"N"
;
string
constr = ConfigurationManager.ConnectionStrings[
"constr"
].ConnectionString;
Your problem is with the Connection string name.
The actual connection string name is ConnectionString and you are passing as constr.
So the error.