daveigh
Programmer
- Oct 9, 2003
- 105
Sorry if my inquiry seems to simple but I am very much beginning to understand C#.
I get this error:
Cannot implicitly convert type 'oUsers' to 'System.Data.DataSet'
on this chunk of code:
public void Populate_DropDownListByTeamID(ref DropDownList dlDropDown, int intTeam_ID, bool ClearBeforePopulate, bool ShowEmptyItem, string EmptyItemText)
{
DataSet dsDataSetUsers = GetByTeamID(intTeam_ID); <-- (error line)
ListItem liItem = new ListItem();
if (ClearBeforePopulate)
dlDropDown.Items.Clear();
if (ShowEmptyItem)
{
liItem = new ListItem();
liItem.Text = EmptyItemText;
liItem.Value = "0";
if (SelectedID == 0)
liItem.Selected = true;
dlDropDown.Items.Add(liItem);
}
foreach (DataRow drRow in dsDataSetUsers.Tables[0].Rows)
{
liItem = new ListItem();
liItem.Text = Convert.ToString(drRow["First_Name"]);
liItem.Value = Convert.ToString(drRow["Team_ID"]);
if (Convert.ToInt32(drRow["Team_ID"]) == intTeamID)
liItem.Selected = true;
dlDropDown.Items.Add(liItem);
}
dsDataSetUsers = null;
}
What I would like to do is create a method to populate the dropdown list control using a stored procedure that retrieves users with team_id of 13.
Any input appreciated. Thanks!
______________CRYOcoustic_____________
I get this error:
Cannot implicitly convert type 'oUsers' to 'System.Data.DataSet'
on this chunk of code:
public void Populate_DropDownListByTeamID(ref DropDownList dlDropDown, int intTeam_ID, bool ClearBeforePopulate, bool ShowEmptyItem, string EmptyItemText)
{
DataSet dsDataSetUsers = GetByTeamID(intTeam_ID); <-- (error line)
ListItem liItem = new ListItem();
if (ClearBeforePopulate)
dlDropDown.Items.Clear();
if (ShowEmptyItem)
{
liItem = new ListItem();
liItem.Text = EmptyItemText;
liItem.Value = "0";
if (SelectedID == 0)
liItem.Selected = true;
dlDropDown.Items.Add(liItem);
}
foreach (DataRow drRow in dsDataSetUsers.Tables[0].Rows)
{
liItem = new ListItem();
liItem.Text = Convert.ToString(drRow["First_Name"]);
liItem.Value = Convert.ToString(drRow["Team_ID"]);
if (Convert.ToInt32(drRow["Team_ID"]) == intTeamID)
liItem.Selected = true;
dlDropDown.Items.Add(liItem);
}
dsDataSetUsers = null;
}
What I would like to do is create a method to populate the dropdown list control using a stored procedure that retrieves users with team_id of 13.
Any input appreciated. Thanks!
______________CRYOcoustic_____________