如果他在sql else add item中存在更新FgTxt
,我想检查Number
中的项目。在谷歌我只找到有关隐藏所有关于所选项目的信息。我只想在DB中使用此索引中的第二项。
loadlist();
ListBoxItem item = (ListBoxItem)ItemListOrder.ItemContainerGenerator.ContainerFromItem(TradeTxt.Text); //it's probably bad idea but this I found and try it
string sitem = item.ToString(); //idk how to take info from 'item'
if (sitem==FgTxt.Text)
{
//update
}
else
{
cmd.CommandText = "Insert Into Conector (Item, Number) values ('" + TradeTxt.Text + "','" + NumberTrTxt.Text + "')";
cmd.ExecuteNonQuery();
cmd.Clone();
}