You Can Change your method like this
private DataSet SelectQuery(string query, params IDataParameter[] sqlParams)
{
try
{
var con=new SqlConnection(connectionString);
using (con)
{
con.Open();
var cmd = new SqlCommand(query, con);
if (sqlParams != null)
{
foreach (IDataParameter para in sqlParams)
{
cmd.Parameters.Add(para);
}
}
using (var sda = new SqlDataAdapter())
{
sda.SelectCommand = cmd;
using (DataSet ds = new DataSet())
{
sda.Fill(ds);
con.Close();
return ds;
}
}
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
And Pass multiple parameters