本文介绍了如何在此代码中使用递归函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private void SaveMact(string ComboxSelectedValue)
{
if (MessageBox.Show("You are about to save current operation. Do you want to proceed?", "Save Data", MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
return;
try
{
using (SqlConnection conn = new SqlConnection(GlobalClass.DataConnectionString))
using (SqlCommand cmdsave = new SqlCommand())
{
conn.Open();
cmdsave.Connection = conn;
foreach (Menuitem mi in oMenuitemlist)
{
if (mi.RowChanged > 0 )
{
cmdsave.CommandText = "UPDATE MENUITEM SET MCAT = @MCAT WHERE MCODE = @MCODE OR PARENT = @MCODE OR MGROUP=@MCODE;
cmdsave.Parameters.AddWithValue(@MCAT, mi.Mcat);
cmdsave.Parameters.AddWithValue(@MCODE, mi.Mcode);
cmdsave.ExecuteNonQuery();
}
}
推荐答案
这篇关于如何在此代码中使用递归函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!