WorkerBeeJ
Programmer
I'm trying to figure out how to find the appropriate row in my dataset without having to do a select that will return one row and then selecting that one row. In vb.net, I'd use the FindByMenuItemID method, but that doesn't seem to be working in c#. Anyone know what I'm doing wrong? Here's the code:
...
private void m_dlMenuItem_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
{
switch (e.CommandName)
{
case ("deleteMenuItem":
// handles the user selecting delete
// and ok'ing the confirm dialog
DataList dl = (DataList)source;
int iItemID = (int)((DataList)source).DataKeys[e.Item.ItemIndex];
DataRow[] oDataRow;
MenuItemDataset.MenuItemRow oItemRow;
oDataRow = m_dsMenuItem.MenuItem.Select("MenuItemID = " + iItemID);
oItemRow = (MenuItemDataset.MenuItemRow)oDataRow[0];
...
Thanks!
...
private void m_dlMenuItem_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
{
switch (e.CommandName)
{
case ("deleteMenuItem":
// handles the user selecting delete
// and ok'ing the confirm dialog
DataList dl = (DataList)source;
int iItemID = (int)((DataList)source).DataKeys[e.Item.ItemIndex];
DataRow[] oDataRow;
MenuItemDataset.MenuItemRow oItemRow;
oDataRow = m_dsMenuItem.MenuItem.Select("MenuItemID = " + iItemID);
oItemRow = (MenuItemDataset.MenuItemRow)oDataRow[0];
...
Thanks!