0

I would like to assign string of array to a datarow array

My code is as follows

protected void btnGenerate_Click(object sender, EventArgs e)
{
    DataRow[] dRow; 
    foreach (GridViewRow grRow in grdACH.Rows)
    {
        CheckBox chkItem = (CheckBox)grRow.FindControl("checkRec");
        if (chkItem.Checked)
        {
            chkItm = true;
            chkcnt++;
            strBankTypeID += ((Label)grRow.FindControl("lblBankType")).Text.ToString();
            strBnkArray = strBankTypeID.Split(',');
            foreach (string str in strBnkArray)
            {
                //Here i have to assign my string of array to datarow
            }
        }
    }
}

Can any one help me

5
  • what is the error, that you are getting by this code? Commented Apr 12, 2011 at 9:11
  • I am getting the error as Cannot implicitly convert type 'string' to 'System.Data.DataRow' Commented Apr 12, 2011 at 9:12
  • can you explain the problem you are trying to solve little more clearly, and the reasoning for solution? Commented Apr 12, 2011 at 9:16
  • Why are you needing to set an array of datarow? Commented Apr 12, 2011 at 9:21
  • @Hath : i will get multiple Id's from the selected so i have to check out by looping through foreach(datarow dr in dRow) Commented Apr 12, 2011 at 9:23

1 Answer 1

1

you'll want to set the GridViewRow.DataItem

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewrow.dataitem.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.