Все, задача решена! Всем спасибо!Pro100Oleh, совет очень помог
Вот рабочий код:
public List<int> AddObjectType(out int id, ObjectType objectType) {
var ret = new List<int>();
using (var sqlConnection = new SqlConnection(_conString)) {
var sqlCommand = new SqlCommand("spAddObjectType", sqlConnection);
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlCommand.Parameters.Add(new SqlParameter("flId", SqlDbType.Int));
sqlCommand.Parameters["flId"].Direction = ParameterDirection.Output;
sqlCommand.Parameters.Add(new SqlParameter("flName", objectType.Name));
sqlCommand.Parameters.Add(new SqlParameter("flDescription", objectType.Description));
sqlCommand.Parameters.Add(new SqlParameter("flCount", 3));
try {
sqlConnection.Open();
var adapter = new SqlDataAdapter(sqlCommand);
var dataSet = new DataSet("ds");
adapter.Fill(dataSet);
id = (int) sqlCommand.Parameters["flId"].Value;
foreach (DataRow row in dataSet.Tables[0].Rows) {
ret.Add((int) row["ObjectId"]);
}
} catch (Exception ex) {
throw ex;
}
}
return ret;
}