SQLHelper 如何调用存储过程~最好有例子,谢谢!

来源:百度知道 编辑:UC知道 时间:2024/05/30 09:19:57
strcon="....";
SqlParameter[] sp = new sqlParameter[5];

...
...
DataSet ds=SqlHelper.ExecuteDataset(strConnection,CommandType.StoredProcedure,"P1",sp);
this.dgrPrdMtl.SetDataBinding(ds,"tables");

中间应该怎么写?怎么加参数?谢谢大家!

SqlCommand comd = new SqlCommand();
comd.Connection = conn;
comd.CommandText = "存储过程名";
comd.CommandType = CommandType.StoredProcedure;
//附加到存储过程的参数;@product存储过程中的参数;product要附加的参数,比方说textbox1.text;;
SqlParameter para1 = comd.Parameters.AddWithValue("@product",product);

SQLHelper 搜索以下SQLHelper的中文翻译很容易就明白了.