I want to use the Row of the Datarow
in my code. What my datarow has the value which comes from the stored procedure. See the code below
public void SendMail()
{
DataSet ds = new DataSet();
using (SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"].ToString()))
{
SqlCommand cmd = new SqlCommand("GET_INWARD_REMINDER_REPORT", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.Fill(ds);
foreach (DataRow dr in ds.Tables[0].Rows)
{
if (dr["UserEmail"].ToString() == "10000")
{
string StrPriBody = "Dear " + dr.Rows[i]["UserName"].ToString() + ", <br /><br /> "+
"This is a test mail for reminder. " +
string StrPriBody = "Dear " + dr.Rows[i]["name"].ToString() + ", <br /><br /> " + } } }
but I am unable to use its Rows.
I tried like this
string StrPriBody = "Dear " + dr.Rows[i]["UserName"].ToString() + ", <br /><br /> "+
but at Rows
i am getting error as
system.data.datarow' does not contain a definition for 'rows'
So how to deal with this.
Also see the datarow screenshot