I want to use something similar like this:
using (DataSet ds = new DataSet())
{
SqlParameter[] dbParams = new SqlParameter[]
{
new SqlParameter("@PromptID", promptID)
};
if (scenarioID != 0)
dbParams.Concat(new SqlParameter("@ScenarioID", scenarioID));
//OR
if (scenarioID != 0)
dbParams.Add(new SqlParameter("@ScenarioID", scenarioID));
}
}
I have searched for adding IEnumarable collection but it doesn't solve my problem. Should I create two collections and concat them? I think there must be an easy way to add an item. Any suggestions?
DataSetat all, by the way...