时间:2021-07-01 10:21:17 帮助过:23人阅读
当传入多个参数时,可以用Dictionary<string, object>,把参数都包含其中,如:
parmWithValue = new Dictionary<string, object>()//http://www.cnblogs.com/txw1958/archive/2012/11/07/csharp-dictionary.html { {"paravalue_delete" ,datadelete_origin}, {"paravalue_update" ,dataupdate}, {"@paravalue_insert" ,datainsert}, }; foreach (var v in parmWithValue) { cmd.Parameters.AddWithValue(v.Key, v.Value);//http://blog.csdn.net/highplayer/article/details/6560167 } SqlDataAdapter sqlDa = new SqlDataAdapter(cmd); resultDs = new DataSet(); sqlDa.Fill(resultDs);
设置好参数后,在传入时遍历每一个参数,其余与其他类型参数传入一模一样。
C#中的datatable类型作为参数传入SQL的存储空间
标签:自定义 其他 fill inf ade ase delete player ble