Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot implicitly convert type 'oUsers' to 'System.Data.DataSet'?

Status
Not open for further replies.

daveigh

Programmer
Oct 9, 2003
105
0
0
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_____________
 
you GetByTeamID method doesn't return the expected dataset into dsDataSetUsers.

whats your GetByTeamID method?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top