日期:2014-05-20 浏览次数:20911 次
void CSQL::SetCommandParameter(System::Data::OleDb::OleDbCommand ^comm,ArrayList ^ params) { [color=#FF0000]IEnumerator^ paramsEnum = params->GetEnumerator();[/color] int i=0; //将params中的参数添加到comm中 while(paramsEnum->MoveNext()) { comm->Parameters->Add("@P"+i.ToString(),paramsEnum->Current); } } int CSQL::Insert(System::String ^insertCommand) { return this->ExcuteNonQuery(insertCommand,nullptr); } int CSQL::Insert(System::String ^insertCommand, ArrayList ^params) { return this->ExcuteNonQuery(insertCommand,params); } int CSQL::Update(System::String ^updateCommand) { return this->ExcuteNonQuery(updateCommand,nullptr); }