how to add a new parameter to SqlParameter[ ] Collection?

后端 未结 5 908
深忆病人
深忆病人 2021-01-20 14:46

I want to use something similar like this:

using (DataSet ds = new DataSet())
{
    SqlParameter[] dbParams = new SqlParameter[]
    {                                


        
5条回答
  •  情歌与酒
    2021-01-20 14:57

    You should use List instead of array.

       List dbParams = new List(); 
    

    and then you can do

       dbParams.Add(new SqlParameter("@PromptID", promptID);
    

提交回复
热议问题