multiple selection in gridviewrow

Hi all

a small question

i am working on project management application

while adding a new project i have to insert users from different groups( by using query string i am getting groups name) users has different type i.e.. PM,TM,User

My question is for one project there is only one PM is allowed, how can i check two PM roles are selected for the same project

i am using grid view to display users from groups and roles

<code>
ArrayList aryGrp = new ArrayList();

cm = new SqlCommand("select groupid from tblGroup where GroupName in('" + szGroups.Replace(",", "','") + "') order by GroupId", cn);

cn.Open();
dr = cm.ExecuteReader();
while (dr.Read())
{
aryGrp.Add(dr["groupid"].ToString());
}

cn.Close();


foreach (GridViewRow grrow in dgUsers.Rows)
{

szUserId = grrow.Cells[0].Text;
intUserType = ((DropDownList)grrow.FindControl("drpRole")).SelectedIndex;
for (int c = 0; c < aryGrp.Count; c++)
{
cm = new SqlCommand("insert into tblProjectAllocation (ProjectID,GroupId,UserID,UserTypeID) values(" + nTemp + "," + Convert.ToInt32(aryGrp[c]) + "," + Convert.ToInt32(szUserId) + "," + intUserType + ")", cn);
cn.Open();
cm.ExecuteNonQuery();
cn.Close();
}
ViewState["users"] = "inserted";
}

</code>

Thanks a lor
[1865 byte] By [tis707] at [2007-11-20 11:40:52]